mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 01:51:40 -05:00
15 lines
356 B
JavaScript
15 lines
356 B
JavaScript
import { UserInputError } from 'apollo-server';
|
|
|
|
/*
|
|
|
|
An error should have:
|
|
|
|
- id: will be used as i18n key (note: available as `name` on the client)
|
|
- message: optionally, a plain-text message
|
|
- data: data/values to give more context to the error
|
|
|
|
*/
|
|
export const throwError = error => {
|
|
const { id, } = error;
|
|
throw new UserInputError(id, error);
|
|
};
|