Skip to content

Commit c04079c

Browse files
committed
0.0.7 release
1 parent 18f9262 commit c04079c

4 files changed

Lines changed: 20 additions & 3 deletions

File tree

gss/DeserializeBytes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,5 @@ func DeserializeBytes(input []byte, format string, input_header []string, input_
8585
return DeserializeYAML(input, output_type)
8686
}
8787

88-
return nil, nil
88+
return nil, errors.Wrap(&ErrUnknownFormat{Name: format}, "could not deserialize bytes")
8989
}

gss/ErrUnknownFormat.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// =================================================================
2+
//
3+
// Copyright (C) 2018 Spatial Current, Inc. - All Rights Reserved
4+
// Released as open source under the MIT License. See LICENSE file.
5+
//
6+
// =================================================================
7+
8+
package gss
9+
10+
type ErrUnknownFormat struct {
11+
Name string // the name of the unknown format
12+
}
13+
14+
// Error returns the error as a string.
15+
func (e ErrUnknownFormat) Error() string {
16+
return "unknown format " + e.Name
17+
}

gss/SerializeBytes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,5 +172,5 @@ func SerializeBytes(input interface{}, format string, header []string, limit int
172172
} else if format == "yaml" {
173173
return yaml.Marshal(input)
174174
}
175-
return make([]byte, 0), nil
175+
return make([]byte, 0), errors.Wrap(&ErrUnknownFormat{Name: format}, "could not serialize object")
176176
}

gss/Version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
package gss
99

1010
// Version is the version of this package and updated during a release.
11-
var Version = "0.0.6"
11+
var Version = "0.0.7"

0 commit comments

Comments
 (0)