Skip to content

Commit

Permalink
fix(core-resource): error getter (#2077)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wroud authored Oct 23, 2023
1 parent f7832b5 commit 9979363
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions webapp/packages/core-resource/src/Resource/Resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ export abstract class Resource<
getException(param: ResourceKeyList<TKey>): Error[] | null;
getException(param: ResourceKey<TKey>): Error[] | Error | null;
getException(param: ResourceKey<TKey>): Error[] | Error | null {
if (param === undefined) {
param = CachedResourceParamKey;
}

if (isResourceKeyList(param)) {
return this.metadata.map(param, metadata => metadata?.exception || null).filter<Error>((exception): exception is Error => exception !== null);
}
Expand Down

0 comments on commit 9979363

Please sign in to comment.