Skip to content

Commit 276ac1f

Browse files
authored
fix #983 RuntimeError does not inherit from Error (#984)
* fix #983 RuntimeError does not inherit from Error * #983 add changelog entity
1 parent 28c1c6e commit 276ac1f

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- _...Add new stuff here..._
55

66
### 🐞 Bug fixes
7-
- _...Add new stuff here..._
7+
- Fix RuntimeError class, make it inherited from Error ([#983](https://github.com/maplibre/maplibre-style-spec/issues/983))
88

99
## 23.1.0
1010

src/expression/runtime_error.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
export class RuntimeError {
2-
name: string;
3-
message: string;
4-
1+
export class RuntimeError extends Error {
52
constructor(message: string) {
6-
this.name = 'ExpressionEvaluationError';
7-
this.message = message;
3+
super(message);
4+
this.name = 'RuntimeError';
85
}
96

107
toJSON() {

0 commit comments

Comments
 (0)