14 lines
531 B
TypeScript
14 lines
531 B
TypeScript
|
import { HttpStatusCode } from "@rocket.chat/apps-engine/definition/accessors";
|
||
|
import { SCIMError, SCIMErrorType } from "../scim/Error";
|
||
|
import { BaseError } from "./BaseError";
|
||
|
|
||
|
export class JsonParseError extends BaseError {
|
||
|
public message = "Failed to parse Rocket.Chat API response content";
|
||
|
public toSCIMError(): SCIMError {
|
||
|
return new SCIMError()
|
||
|
.setStatus(HttpStatusCode.INTERNAL_SERVER_ERROR)
|
||
|
.setScimType(SCIMErrorType.INVALID_VALUE)
|
||
|
.setDetail(this.message);
|
||
|
}
|
||
|
}
|