@magda/utils 2.0.0-alpha.4 → 2.0.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -178,6 +178,16 @@ export declare function retryBackoff<T>(op: () => Promise<T>, delaySeconds: numb
178
178
 
179
179
  export declare function runLater<TResult>(milliseconds: number, functionToRunLater: () => Promise<TResult> | TResult): Promise<TResult>;
180
180
 
181
+ declare class ServerError extends Error {
182
+ statusCode: number;
183
+ constructor(message?: string, statusCode?: number);
184
+ toData(): {
185
+ isError: boolean;
186
+ errorCode: number;
187
+ errorMessage: string;
188
+ };
189
+ }
190
+
181
191
  export declare class ServiceError extends Error {
182
192
  e: any;
183
193
  constructor(message: string, e: any);
@@ -185,6 +195,6 @@ export declare class ServiceError extends Error {
185
195
 
186
196
  export declare function setDefaultRequestInitOptions(options: RequestInit): void;
187
197
 
188
- export declare function unionToThrowable<T>(input: T | Error): T;
198
+ export declare function unionToThrowable<T>(input: T | Error | ServerError): T;
189
199
 
190
200
  export { }