UNPKG

@scaleway/sdk-client

Version:
25 lines (24 loc) 683 B
import { ScalewayError } from "../scw-error.js"; class ResourceNotFoundError extends ScalewayError { constructor(status, body, resource, resourceId) { super( status, body, `resource ${resource} with ID ${resourceId} is not found` ); this.status = status; this.body = body; this.resource = resource; this.resourceId = resourceId; this.name = "ResourceNotFoundError"; } static fromJSON(status, obj) { if (typeof obj.resource !== "string" || typeof obj.resource_id !== "string") { return null; } return new ResourceNotFoundError(status, obj, obj.resource, obj.resource_id); } } export { ResourceNotFoundError };