Skip to content

Commit

Permalink
Merge pull request #23 from tcavenezuela/fix/change-throw
Browse files Browse the repository at this point in the history
fix: change throw error to avoid use new Error since we are returning a JSON to improve error parsing
  • Loading branch information
carl0shd authored Jul 2, 2024
2 parents 527e447 + 707dfc1 commit 5885a1c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/funny-meals-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fsuipc.js/api': patch
---

change throw error to avoid use new Error since we are returning a JSON to improve error parsing
4 changes: 2 additions & 2 deletions packages/api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class FsuipcApi {
terminateOnError = true
): Observable<ConvertedOffsetValues> {
if (!this.fsuipc) {
return throwError(() => new Error('NO_FSUIPC_INSTANCE'));
return throwError(() => 'NO_FSUIPC_INSTANCE');
}

this.watchOffsets(offsetList);
Expand Down Expand Up @@ -75,7 +75,7 @@ export class FsuipcApi {
this.fsuipc.close();
}

return throwError(() => new Error(JSON.stringify(error)));
return throwError(() => JSON.stringify(error));
})
)
)
Expand Down

0 comments on commit 5885a1c

Please sign in to comment.