mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-12-21 16:11:50 +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]
|
|
}
|