v2 / vlib / x / async / errors.v
22 lines · 19 sloc · 1.17 KB · 15fb60b77ea6073658aa8355b247f2e1ae03b714
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_wait_called = 'async: group wait was already called'
8const err_interval_invalid = 'async: interval must be positive'
9const err_nil_job = 'async: job function is nil'
10const err_pool_closed = 'async: pool is closed'
11const err_pool_queue_full = 'async: pool queue is full'
12const err_pool_queue_size_invalid = 'async: pool queue size must be positive'
13const err_pool_wait_called = 'async: pool wait was already called'
14const err_pool_workers_invalid = 'async: pool worker count must be positive'
15const err_task_wait_called = 'async: task wait was already called'
16const err_timeout = 'async: timeout'
17
18const context_canceled = 'context canceled'
19
20// The current context module exposes deadline expiry as an IError with this
21// message. x.async normalizes that specific deadline error to `async: timeout`.
22const context_deadline_exceeded = 'context deadline exceeded'
23