@scaleway/sdk-client
Version:
Scaleway SDK Client
18 lines (17 loc) • 500 B
JavaScript
import { ScalewayError } from "../scw-error.js";
class OutOfStockError extends ScalewayError {
constructor(status, body, resource) {
super(status, body, `resource ${resource} is out of stock`);
this.status = status;
this.body = body;
this.resource = resource;
this.name = "OutOfStockError";
}
static fromJSON(status, obj) {
if (typeof obj.resource !== "string") return null;
return new OutOfStockError(status, obj, obj.resource);
}
}
export {
OutOfStockError
};