feat(eventstore): sdk (#39)

* sdk

* fix(sdk): return correct error type

* AppendEventError instead of Aggregater error

* fix(tests): tests

* fix(tests): wantErr to is error func
This commit is contained in:
Silvan
2020-04-07 18:36:37 +02:00
committed by GitHub
parent 970586dfc9
commit 191690d905
27 changed files with 524 additions and 234 deletions

View File

@@ -19,7 +19,7 @@ type {{.ErrorName}}Error struct {
}
func Throw{{.ErrorName}}(parent error, id, message string) error {
return &{{.ErrorName}}Error{createCaosError(parent, id, message)}
return &{{.ErrorName}}Error{CreateCaosError(parent, id, message)}
}
func Throw{{.ErrorName}}f(parent error, id, format string, a ...interface{}) error {

View File

@@ -12,7 +12,7 @@ import (
func Test{{.ErrorName}}Error(t *testing.T) {
var err interface{}
err = new(caos_errs.{{.ErrorName}}Error)
_, ok := err.(caos_errs.{{.ErrorName}})
_, ok := err.(*caos_errs.{{.ErrorName}})
assert.True(t, ok)
}