-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmidi_errors.go
79 lines (53 loc) · 1.67 KB
/
midi_errors.go
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Copyright 2012 Joe Wass. All rights reserved.
// Use of this source code is governed by the MIT license
// which can be found in the LICENSE file.
// MIDI package
// A package for reading Standard Midi Files, written in Go.
// Joe Wass 2012
/*
* Errors that may arise during parsing.
* The LexerCallback may recieve any of these.
*/
package midi
// A load of Errors and single values for convenience.
type UnexpectedEventLengthError struct {
message string
}
func (e UnexpectedEventLengthError) Error() string {
return e.message
}
type NoCallbackError struct{}
func (e NoCallbackError) Error() string {
return "No callback supplied"
}
var NoCallback = NoCallbackError{}
type NoReadSeekerError struct{}
func (e NoReadSeekerError) Error() string {
return "No ReadSeeker input supplied"
}
var NoReadSeeker = NoReadSeekerError{}
type VarLengthNotFoundError struct{}
func (e VarLengthNotFoundError) Error() string {
return "Variable length value not found where expected."
}
type UnexpectedEndOfFileError struct{}
func (e UnexpectedEndOfFileError) Error() string {
return "Unexpected End of File found."
}
var UnexpectedEndOfFile = UnexpectedEndOfFileError{}
type UnsupportedSmfFormatError struct{}
func (e UnsupportedSmfFormatError) Error() string {
return "The SMF format was not expected."
}
var UnsupportedSmfFormat = UnsupportedSmfFormatError{}
type ExpectedMthdError struct{}
func (e ExpectedMthdError) Error() string {
return "Expected SMF Midi header."
}
var ExpectedMthd = ExpectedMthdError{}
type BadSizeChunkError struct{}
func (e BadSizeChunkError) Error() string {
return "Chunk was an unexpected size."
}
var BadSizeChunk = BadSizeChunkError{}