@rnzeus/atlas 0.1.2 → 0.1.3
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.
|
@@ -3,7 +3,7 @@ export default abstract class Transport {
|
|
|
3
3
|
private headersDefault;
|
|
4
4
|
protected abstract get baseURL(): string;
|
|
5
5
|
protected abstract formatErrorMessage(data: unknown, status: number): string;
|
|
6
|
-
protected notify(_message: string): void;
|
|
6
|
+
protected notify(_message: string, _status?: number): void;
|
|
7
7
|
get headers(): HeadersInit_;
|
|
8
8
|
set headers(next: HeadersInit_);
|
|
9
9
|
protected request<T>(url: string, options?: TransportOptions, params?: Record<string, unknown> | null): Promise<T>;
|
|
@@ -14,7 +14,7 @@ export default class Transport {
|
|
|
14
14
|
this.put = this.transportMethods.put.bind(this.transportMethods);
|
|
15
15
|
this.delete = this.transportMethods.delete.bind(this.transportMethods);
|
|
16
16
|
}
|
|
17
|
-
notify(_message) {
|
|
17
|
+
notify(_message, _status) {
|
|
18
18
|
/* no-op */
|
|
19
19
|
}
|
|
20
20
|
get headers() {
|
|
@@ -50,7 +50,7 @@ export default class Transport {
|
|
|
50
50
|
const message = this.formatErrorMessage(responseData, response.status);
|
|
51
51
|
const transportErrorException = new TransportErrorException(response.status, message, responseData);
|
|
52
52
|
if (transportErrorException.isServerError()) {
|
|
53
|
-
this.notify(message);
|
|
53
|
+
this.notify(message, response.status);
|
|
54
54
|
}
|
|
55
55
|
throw transportErrorException;
|
|
56
56
|
}
|