mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-12-19 07:02:00 +03:00
11 lines
279 B
JavaScript
11 lines
279 B
JavaScript
import HttpError from '@wasp/core/HttpError.js'
|
|
|
|
import state from './state.js'
|
|
|
|
export const createTask = (task, context) => {
|
|
if (Math.random() < 0.5) {
|
|
throw new HttpError(400, 'Failed to create task, random error!')
|
|
}
|
|
state.tasks = [...(state.tasks || []), task]
|
|
}
|