forked from GuiaBolso/darwin
-
Notifications
You must be signed in to change notification settings - Fork 11
/
errors.go
46 lines (37 loc) · 1.27 KB
/
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
package darwin
import "fmt"
// DuplicateMigrationVersionError is used to report when the migration list has
// duplicated entries.
type DuplicateMigrationVersionError struct {
Version float64
}
// Error implements the error interface.
func (d *DuplicateMigrationVersionError) Error() string {
return fmt.Sprintf("Multiple migrations have the version number %f.", d.Version)
}
// IllegalMigrationVersionError is used to report when the migration has an
// illegal Version number.
type IllegalMigrationVersionError struct {
Version float64
}
// Error implements the error interface.
func (i *IllegalMigrationVersionError) Error() string {
return fmt.Sprintf("Illegal migration version number %f.", i.Version)
}
// RemovedMigrationError is used to report when a migration is removed from
// the list.
type RemovedMigrationError struct {
Version float64
}
// Error implements the error interface.
func (r *RemovedMigrationError) Error() string {
return fmt.Sprintf("Migration %f was removed", r.Version)
}
// InvalidChecksumError is used to report when a migration was modified.
type InvalidChecksumError struct {
Version float64
}
// Error implements the error interface.
func (i *InvalidChecksumError) Error() string {
return fmt.Sprintf("Invalid checksum for migration %f", i.Version)
}