mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 08:33:11 +00:00
refactor: split api into api, api-cli & api-plugin
This commit is contained in:
@@ -20,7 +20,6 @@ import {SCErrorResponse, SCLicensePlate, SCSearchRequest, SCThings} from '@opens
|
||||
export class ApiError extends Error {
|
||||
/**
|
||||
* Instantiate a new error
|
||||
*
|
||||
* @param data Representation of an error that happened in the backend
|
||||
*/
|
||||
constructor(protected data: Partial<SCErrorResponse>) {
|
||||
@@ -38,12 +37,12 @@ export class ApiError extends Error {
|
||||
let string_ = super.toString();
|
||||
|
||||
// add additional data
|
||||
if (typeof this.data.additionalData !== 'undefined') {
|
||||
if (this.data.additionalData !== undefined) {
|
||||
string_ += `\n\n${JSON.stringify(this.data.additionalData)}`;
|
||||
}
|
||||
|
||||
// add "remote" stack trace
|
||||
if (typeof this.data.stack !== 'undefined') {
|
||||
if (this.data.stack !== undefined) {
|
||||
string_ += `\n\n${this.data.stack}`;
|
||||
}
|
||||
|
||||
@@ -57,7 +56,6 @@ export class ApiError extends Error {
|
||||
export class OutOfRangeError extends ApiError {
|
||||
/**
|
||||
* Instantiate a new error
|
||||
*
|
||||
* @param searchRequest Search request where window is out of range
|
||||
*/
|
||||
constructor(searchRequest: SCSearchRequest) {
|
||||
@@ -75,7 +73,6 @@ export class OutOfRangeError extends ApiError {
|
||||
export class BulkWithMultipleTypesError extends ApiError {
|
||||
/**
|
||||
* Instantiate a new error
|
||||
*
|
||||
* @param offendingThing Thing that has a different type than the previous things
|
||||
*/
|
||||
constructor(offendingThing: SCThings) {
|
||||
|
||||
Reference in New Issue
Block a user