-
Notifications
You must be signed in to change notification settings - Fork 0
/
Error.js
51 lines (48 loc) · 1.16 KB
/
Error.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
class TmError {
constructor(err, pos, arg) {
this.name = err
this.arg = arg
this.pos = pos === null ? [] : [pos]
}
toJSON() {
return {
Err: this.name,
Arg: this.arg,
Pos: this.pos
}
}
}
TmError.Types = {
Section: {
DiffDuration: 'Section::DiffDuration',
InitiativeBar: 'Section::InitiativeBar',
FinalBar: 'Section::FinalBar',
Mismatch: 'Section::Mismatch'
},
Track: {
BarLength: 'Track::BarLength',
UnexpVolta: 'Track::UnexpVolta',
UnexpCoda: 'Track::UnexpCoda',
MultiCoda: 'Track::MultiCoda',
MultiVolta: 'Track::MultiVolta',
Instrument: 'Track::Instrument',
Undefined: 'Track::Undefined',
FadeOverLong: 'Track::FadeOverLong'
},
Note: {
ChordRange: 'Note::ChordRange',
ChordOverride: 'Note::ChordOverride',
Reduplicate: 'Note::Reduplicate',
OutOfRegister: 'Note::OutOfRegister',
ScaleDegree: 'Note::ScaleDegree',
NoPrevious: 'Note::NoPrevious',
VolumeLimit: 'Note::VolumeLimit'
},
Arg: {
OutOfRange: 'Arg::OutOfRange',
UniNote: 'Arg::UniNote',
NotLog2: 'Arg::NotLog2',
WrongType: 'Arg::WrongType'
}
}
module.exports = TmError