Skip to content

Commit

Permalink
Merge pull request #21 from modelcreate/error-handling
Browse files Browse the repository at this point in the history
dont throw on warning
  • Loading branch information
lbutler authored Jan 26, 2020
2 parents 8ccfa0f + ae68168 commit ba4c8ad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/epanet-js/src/Project/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ class Project
_checkError(errorCode: number) {
if (errorCode === 0) {
return;
} else if (errorCode < 100) {
console.warn(`epanet-js: ${this._ws.getError(errorCode)}`);
return;
}
const errorMsg = this._ws.getError(errorCode);
throw new Error(errorMsg);
Expand Down

0 comments on commit ba4c8ad

Please sign in to comment.