@hashrytech/quick-components-kit 0.12.3 → 0.12.4
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.
package/CHANGELOG.md
CHANGED
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
{#if label}{@render label()}{:else}{#if labelText}<label for={id} class="text-sm font-medium text-neutral-600 ml-1">{labelText}</label>{/if}{/if}
|
|
73
73
|
<div class="relative">
|
|
74
74
|
{#if icon}<div class="absolute inset-y-0 left-0 flex items-center justify-center rounded-l-primary m-0.5 w-10">{@render icon()}</div>{/if}
|
|
75
|
-
<input {disabled} {required} {type} {id} {name} {placeholder} {onchange} {onmouseup} bind:value
|
|
75
|
+
<input {disabled} {required} {type} {id} name={name ? name: id} {placeholder} {onchange} {onmouseup} bind:value
|
|
76
76
|
class={twMerge("rounded-primary border-border-primary focus:border-primary-500 focus:ring-primary-500 placeholder:opacity-50 disabled:bg-neutral-300/30 disabled:border-gray-300/30",
|
|
77
77
|
error ? "bg-red-50 border-red-300 ring-red-300" : "",
|
|
78
78
|
icon ? "pl-10" : "",
|
|
@@ -205,7 +205,7 @@ export class ApiClient {
|
|
|
205
205
|
}
|
|
206
206
|
// Re-throw the error if it hasn't been "handled" by a handler (e.g., by redirecting)
|
|
207
207
|
// This ensures the calling context can still catch and react to the error.
|
|
208
|
-
throw err;
|
|
208
|
+
//throw err; //Not rethrowing the error here, as we want to return ApiResponse with error details.
|
|
209
209
|
}
|
|
210
210
|
/**
|
|
211
211
|
* Generic request method. All other HTTP methods call this.
|
|
@@ -230,8 +230,9 @@ export class ApiClient {
|
|
|
230
230
|
}
|
|
231
231
|
catch (error) {
|
|
232
232
|
await this.handleError(error);
|
|
233
|
-
const
|
|
234
|
-
const
|
|
233
|
+
const isApiError = error instanceof ApiError;
|
|
234
|
+
const status = isApiError ? error.status : 0; // 0 = network error or unknown
|
|
235
|
+
const message = error instanceof Error ? error.message : 'Unexpected error occurred';
|
|
235
236
|
return {
|
|
236
237
|
ok: false,
|
|
237
238
|
status,
|