huge refactoring

This commit is contained in:
Julien Neuhart
2019-07-23 13:57:18 +02:00
parent f6b357691c
commit 7bfbda4490
105 changed files with 4051 additions and 2667 deletions

View File

@@ -0,0 +1,6 @@
/*
Package xerrortest contains useful
functions for tests related
to xerror package.
*/
package xerrortest

View File

@@ -0,0 +1,18 @@
package xerrortest
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/thecodingmachine/gotenberg/internal/pkg/xerror"
)
// AssertError validates that given error
// is of an instance of xerror.Error.
// If so, returns the instance of xerror.Error.
func AssertError(t *testing.T, err error) *xerror.Error {
assert.NotNil(t, err)
standardized, ok := err.(*xerror.Error)
assert.Equal(t, true, ok)
return standardized
}