vxx2 / vlib / x / async / errors.v
24 lines · 21 sloc · 1.32 KB · a66aa5b0fe618b32988f4fd9b235017c336940ba
Raw
1module async
2
3// Error strings are centralized because they form the observable contract for
4// callers and tests. Keep them short, stable, and explicit about whether the
5// failure came from x.async or from the parent context.
6const err_group_go_after_wait = 'async: group does not accept new tasks after wait starts'
7const err_group_max_errors_invalid = 'async: group max_errors must be positive'
8const err_group_wait_called = 'async: group wait was already called'
9const err_interval_invalid = 'async: interval must be positive'
10const err_nil_job = 'async: job function is nil'
11const err_periodic_wait_called = 'async: periodic wait was already called'
12const err_pool_closed = 'async: pool is closed'
13const err_pool_queue_full = 'async: pool queue is full'
14const err_pool_queue_size_invalid = 'async: pool queue size must be positive'
15const err_pool_wait_called = 'async: pool wait was already called'
16const err_pool_workers_invalid = 'async: pool worker count must be positive'
17const err_task_wait_called = 'async: task wait was already called'
18const err_timeout = 'async: timeout'
19
20const context_canceled = 'context canceled'
21
22// The current context module exposes deadline expiry as an IError with this
23// message. x.async normalizes that specific deadline error to `async: timeout`.
24const context_deadline_exceeded = 'context deadline exceeded'
25