Skip to content

Commit

Permalink
Improve IPC serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Oct 30, 2022
1 parent 7845038 commit fdc0506
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/run/process/task_error.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export const throwOnTaskError = function ({ error: errorObject }) {

const error = AnyError.parse(errorObject)
const name = getName(error)
const { ErrorClass, prefix } = ERROR_PROPS[name]
throw new ErrorClass(prefix, { cause: error })
const { ErrorClass, prefix, stack } = ERROR_PROPS[name]
throw new ErrorClass(prefix, { cause: error, cli: { stack } })
}

const getName = function (error) {
Expand All @@ -34,26 +34,32 @@ const ERROR_PROPS = {
UnknownError: {
ErrorClass: PluginError,
prefix: 'Runner internal bug.',
stack: true,
},
IpcSerializationError: {
ErrorClass: PluginError,
prefix: 'Serialization error.',
stack: true,
},
TasksLoadError: {
ErrorClass: UserCodeError,
prefix: 'Could not load the tasks file.',
stack: true,
},
TasksSyntaxError: {
ErrorClass: UserCodeError,
prefix: 'Syntax error in the tasks file.',
stack: false,
},
TasksRunError: {
ErrorClass: UserCodeError,
prefix: 'Could not run the task.',
stack: true,
},
ConfigError: {
ErrorClass: UserError,
prefix: 'Runner configuration error.',
stack: false,
},
}

Expand Down

0 comments on commit fdc0506

Please sign in to comment.