mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 17:12:43 +00:00
feat: add model for syntax error
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018 StApps
|
* Copyright (C) 2018-2019 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -127,6 +127,20 @@ export class SCNotFoundErrorResponse extends SCError {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An error that is returned whenever there is a syntax error
|
||||||
|
*/
|
||||||
|
export class SCSyntaxError extends SCError {
|
||||||
|
/**
|
||||||
|
* Create a SyntaxError
|
||||||
|
* @param message Describes the syntax error
|
||||||
|
* @param stack Set to true if a stack trace should be created
|
||||||
|
*/
|
||||||
|
constructor(message: string, stack?: boolean) {
|
||||||
|
super('SyntaxError', message, 400, stack);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An error that is returned, when an internal server error occurred
|
* An error that is returned, when an internal server error occurred
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018 StApps
|
* Copyright (C) 2018-2019 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -31,6 +31,7 @@ export class SCIndexRoute extends SCAbstractRoute {
|
|||||||
this.errorNames = [
|
this.errorNames = [
|
||||||
'SCInternalServerErrorResponse',
|
'SCInternalServerErrorResponse',
|
||||||
'SCMethodNotAllowedErrorResponse',
|
'SCMethodNotAllowedErrorResponse',
|
||||||
|
'SCSyntaxError',
|
||||||
'SCUnsupportedMediaTypeErrorResponse',
|
'SCUnsupportedMediaTypeErrorResponse',
|
||||||
'SCValidationErrorResponse',
|
'SCValidationErrorResponse',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018 StApps
|
* Copyright (C) 2018-2019 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -32,6 +32,7 @@ export class SCThingUpdateRoute extends SCAbstractRoute {
|
|||||||
'SCInternalServerErrorResponse',
|
'SCInternalServerErrorResponse',
|
||||||
'SCMethodNotAllowedErrorResponse',
|
'SCMethodNotAllowedErrorResponse',
|
||||||
'SCNotFoundErrorResponse',
|
'SCNotFoundErrorResponse',
|
||||||
|
'SCSyntaxError',
|
||||||
'SCUnsupportedMediaTypeErrorResponse',
|
'SCUnsupportedMediaTypeErrorResponse',
|
||||||
'SCValidationErrorResponse',
|
'SCValidationErrorResponse',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018 StApps
|
* Copyright (C) 2018-2019 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -63,6 +63,7 @@ export class SCBookAvailabilityRoute extends SCAbstractRoute {
|
|||||||
'SCInternalServerErrorResponse',
|
'SCInternalServerErrorResponse',
|
||||||
'SCMethodNotAllowedErrorResponse',
|
'SCMethodNotAllowedErrorResponse',
|
||||||
'SCNotFoundErrorResponse',
|
'SCNotFoundErrorResponse',
|
||||||
|
'SCSyntaxError',
|
||||||
'SCUnsupportedMediaTypeErrorResponse',
|
'SCUnsupportedMediaTypeErrorResponse',
|
||||||
'SCValidationErrorResponse',
|
'SCValidationErrorResponse',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018 StApps
|
* Copyright (C) 2018-2019 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -62,6 +62,7 @@ export class SCBulkRoute extends SCAbstractRoute {
|
|||||||
this.errorNames = [
|
this.errorNames = [
|
||||||
'SCInternalServerErrorResponse',
|
'SCInternalServerErrorResponse',
|
||||||
'SCMethodNotAllowedErrorResponse',
|
'SCMethodNotAllowedErrorResponse',
|
||||||
|
'SCSyntaxError',
|
||||||
'SCUnsupportedMediaTypeErrorResponse',
|
'SCUnsupportedMediaTypeErrorResponse',
|
||||||
'SCValidationErrorResponse',
|
'SCValidationErrorResponse',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018 StApps
|
* Copyright (C) 2018-2019 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -31,6 +31,7 @@ export class SCBulkAddRoute extends SCAbstractRoute {
|
|||||||
'SCInternalServerErrorResponse',
|
'SCInternalServerErrorResponse',
|
||||||
'SCMethodNotAllowedErrorResponse',
|
'SCMethodNotAllowedErrorResponse',
|
||||||
'SCNotFoundErrorResponse',
|
'SCNotFoundErrorResponse',
|
||||||
|
'SCSyntaxError',
|
||||||
'SCUnsupportedMediaTypeErrorResponse',
|
'SCUnsupportedMediaTypeErrorResponse',
|
||||||
'SCValidationErrorResponse',
|
'SCValidationErrorResponse',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018 StApps
|
* Copyright (C) 2018-2019 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -31,6 +31,7 @@ export class SCBulkDoneRoute extends SCAbstractRoute {
|
|||||||
'SCInternalServerErrorResponse',
|
'SCInternalServerErrorResponse',
|
||||||
'SCMethodNotAllowedErrorResponse',
|
'SCMethodNotAllowedErrorResponse',
|
||||||
'SCNotFoundErrorResponse',
|
'SCNotFoundErrorResponse',
|
||||||
|
'SCSyntaxError',
|
||||||
'SCUnsupportedMediaTypeErrorResponse',
|
'SCUnsupportedMediaTypeErrorResponse',
|
||||||
'SCValidationErrorResponse',
|
'SCValidationErrorResponse',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018 StApps
|
* Copyright (C) 2018-2019 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -71,6 +71,7 @@ export class SCFeedbackRoute extends SCAbstractRoute {
|
|||||||
this.errorNames = [
|
this.errorNames = [
|
||||||
'SCInternalServerErrorResponse',
|
'SCInternalServerErrorResponse',
|
||||||
'SCMethodNotAllowedErrorResponse',
|
'SCMethodNotAllowedErrorResponse',
|
||||||
|
'SCSyntaxError',
|
||||||
'SCUnsupportedMediaTypeErrorResponse',
|
'SCUnsupportedMediaTypeErrorResponse',
|
||||||
'SCValidationErrorResponse',
|
'SCValidationErrorResponse',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018 StApps
|
* Copyright (C) 2018-2019 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -37,6 +37,7 @@ export class SCMultiSearchRoute extends SCAbstractRoute {
|
|||||||
this.errorNames = [
|
this.errorNames = [
|
||||||
'SCInternalServerErrorResponse',
|
'SCInternalServerErrorResponse',
|
||||||
'SCMethodNotAllowedErrorResponse',
|
'SCMethodNotAllowedErrorResponse',
|
||||||
|
'SCSyntaxError',
|
||||||
'SCTooManyRequestsErrorResponse',
|
'SCTooManyRequestsErrorResponse',
|
||||||
'SCUnsupportedMediaTypeErrorResponse',
|
'SCUnsupportedMediaTypeErrorResponse',
|
||||||
'SCValidationErrorResponse',
|
'SCValidationErrorResponse',
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018 StApps
|
* Copyright (C) 2018-2019 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -63,6 +63,7 @@ export class SCSearchRoute extends SCAbstractRoute {
|
|||||||
this.errorNames = [
|
this.errorNames = [
|
||||||
'SCInternalServerErrorResponse',
|
'SCInternalServerErrorResponse',
|
||||||
'SCMethodNotAllowedErrorResponse',
|
'SCMethodNotAllowedErrorResponse',
|
||||||
|
'SCSyntaxError',
|
||||||
'SCUnsupportedMediaTypeErrorResponse',
|
'SCUnsupportedMediaTypeErrorResponse',
|
||||||
'SCValidationErrorResponse',
|
'SCValidationErrorResponse',
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user