Skip to content

Commit

Permalink
remove console.error
Browse files Browse the repository at this point in the history
  • Loading branch information
rsdc2 committed Feb 14, 2024
1 parent 352a108 commit c05d4f2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/Errors/mode.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { ISicElementIDError } from "./isicElementIDError.js";

export class InvalidModeError extends Error {

}
4 changes: 3 additions & 1 deletion src/Pure/format.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import Constants from "./constants/constants.js"
import { BaseIndexError } from "../Errors/base.js"


export default class Format {

Expand All @@ -21,7 +23,7 @@ export default class Format {
return "ISic" + padded.slice(0, 6) + "-" + padded.slice(6, 10)
}
else {
console.error("Invalid base")
throw new BaseIndexError(baseIdx)
}

}
Expand Down
7 changes: 4 additions & 3 deletions src/SideEffects/status.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import Attrs from "./attrs.js"
import Elems from "./elems.js"
import { InvalidModeError } from "../Errors/mode.js"

export default class Status {
/**
* @returns {"compression"|"midpoint"|"error"}
* @returns {"compression"|"midpoint"}
*/
static selectionMode = () => {

Expand All @@ -13,7 +14,7 @@ export default class Status {
return "midpoint"
}

console.error("Invalid selection mode")
return "error"
// This should never happen
throw new InvalidModeError(`Invalid selection mode`)
}
}

0 comments on commit c05d4f2

Please sign in to comment.