UNPKG

@scaleway/sdk-client

Version:
21 lines (20 loc) 758 B
"use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); const scwError = require("../scw-error.cjs"); class ResourceLockedError extends scwError.ScalewayError { constructor(status, body, resource, resourceId) { super(status, body, `resource ${resource} with ID ${resourceId} is locked`); this.status = status; this.body = body; this.resource = resource; this.resourceId = resourceId; this.name = "ResourceLockedError"; } static fromJSON(status, obj) { if (typeof obj.resource !== "string" || typeof obj.resource_id !== "string") { return null; } return new ResourceLockedError(status, obj, obj.resource, obj.resource_id); } } exports.ResourceLockedError = ResourceLockedError;