mirror of
https://github.com/archtechx/airwire.git
synced 2025-12-12 02:34:04 +00:00
improve error handling
This commit is contained in:
parent
9fffe87970
commit
459b74eb18
3 changed files with 16 additions and 10 deletions
|
|
@ -187,7 +187,7 @@ export class Component<AirwireComponent = TypeMap[keyof TypeMap]>
|
|||
|
||||
return reason
|
||||
})
|
||||
.then((json: ComponentResponse<AirwireComponent>) => { // todo this then() shouldn't execute if previous catch() executes
|
||||
.then((json: ComponentResponse<AirwireComponent>) => {
|
||||
if (json?.metadata?.errors) {
|
||||
this.errors = json.metadata.errors
|
||||
}
|
||||
|
|
@ -227,7 +227,11 @@ export class Component<AirwireComponent = TypeMap[keyof TypeMap]>
|
|||
let result = null;
|
||||
try {
|
||||
result = callback();
|
||||
} catch (e) { }
|
||||
} catch (e) {
|
||||
this.pausedRequests = false;
|
||||
|
||||
throw e
|
||||
}
|
||||
|
||||
this.pausedRequests = false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue