Skip to content

Commit ee7f45b

Browse files
committed
docs: add error code reference
1 parent a3c1b23 commit ee7f45b

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
id: Errors
3+
sidebar_position: 8
4+
---
5+
6+
## Errors
7+
8+
The following section aggregates all the error codes thrown from `Piscina` and an explanation of them
9+
10+
### Constructor
11+
12+
All errors thrown by `Piscina` follows are child of `PiscinaError` parent class.
13+
14+
- `name`: (`string`) Name of the error
15+
- `code`: (`string`) Error code. Prefixed with `PISCINA_ERR_*`
16+
- `message`: (`string | null`) Summary of the cause of the error
17+
- `cause`: (`string | null`) Root cause of the error.
18+
19+
### Error Codes
20+
21+
| Code | Description |
22+
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
23+
| PISCINA_ERR_ABORT | Indicates a task has been aborted. Seek for the `cause` property to find more about the root cause. |
24+
| PISCINA_ERR_TASK_QUEUE_LIMIT | Task queue is at limit. No more tasks are being enqueued. Listen to the `drain` and `needsDrain` event to continue submitting tasks |
25+
| PISCINA_ERR_THREAD_TERMINATION | Thread is being terminated. |
26+
| PISCINA_ERR_VALIDATION | Validation for given values has failed. Review the `message` property for more information |
27+
| PISCINA_ERR_NO_TASK_QUEUE_AVAILABLE | Task queue has been disabled and workers are at full capacity. Listen to `drain` and `needsDrain` events to continue submitting tasks |
28+
| PISCINA_ERR_CLOSE_TIMEOUT | Pool has exceeded timeout for closing up. Pool will be destroyed immediately. |

0 commit comments

Comments
 (0)