Skip to content

Commit a78dc00

Browse files
GitanjaliChhetrihackermdigoroctaviano
authored
refactor(viewer.js): Add errorinterceptor argument to propagate error to the top level app (#85)
* add-error-interceptor * Apply suggestions from code review Co-authored-by: Markus D. Herrmann <[email protected]> * Update documentation comments and add Error variables * add custom error class * fix linting errors * dummy commit to trigger actions workflow * update file name * Update PR * Update PR: Update signature * Lint * Revert "fix: Setup the dynamic import so it is separate from other packages (#113)" This reverts commit 2834944. * Fix enum * Revert "Revert "fix: Setup the dynamic import so it is separate from other packages (#113)"" This reverts commit f5abca9. --------- Co-authored-by: Markus D. Herrmann <[email protected]> Co-authored-by: Igor Octaviano <[email protected]>
1 parent 45a2ff8 commit a78dc00

File tree

2 files changed

+264
-68
lines changed

2 files changed

+264
-68
lines changed

src/customError.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const errorTypes = {
2+
VISUALIZATION: 'Visualization',
3+
ENCODINGANDDECODING: 'EncodingDecoding'
4+
}
5+
6+
class CustomError extends Error {
7+
constructor (type, message) {
8+
super()
9+
this.message = message
10+
this.stack = new Error().stack
11+
this.type = type
12+
}
13+
}
14+
15+
export { errorTypes, CustomError }

0 commit comments

Comments
 (0)