osl-base-extended 1.0.16 → 1.0.18
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.
|
@@ -245,10 +245,13 @@ class Httpbase {
|
|
|
245
245
|
result: null,
|
|
246
246
|
};
|
|
247
247
|
}
|
|
248
|
+
flatObject(object) {
|
|
249
|
+
return Object.values(object)?.flat()?.map((x) => x.toString());
|
|
250
|
+
}
|
|
248
251
|
mapError(error) {
|
|
249
252
|
switch (error.status) {
|
|
250
253
|
case 0: return 'Connection Error! Please Contact Administration';
|
|
251
|
-
case 400: return error.error?.message || 'Bad Request';
|
|
254
|
+
case 400: return error.error?.errors ? this.flatObject(error.error?.errors) : error.error?.message || 'Bad Request';
|
|
252
255
|
case 401: return 'Unauthorized Access';
|
|
253
256
|
case 403: return "You don't have rights to perform this action";
|
|
254
257
|
case 404: return 'Resource not found';
|