-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Maciej Winnicki
committed
Feb 12, 2018
1 parent
80c6319
commit 8945d40
Showing
8 changed files
with
98 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,59 @@ | ||
package function | ||
|
||
import "fmt" | ||
import ( | ||
"fmt" | ||
) | ||
|
||
// ErrFunctionNotFound occurs when function couldn't been found in the discovery. | ||
type ErrFunctionNotFound struct { | ||
ID ID | ||
} | ||
|
||
func (e ErrFunctionNotFound) Error() string { | ||
return fmt.Sprintf("Function %q not found.", string(e.ID)) | ||
} | ||
|
||
// ErrFunctionAlreadyRegistered occurs when function with specified name is already registered. | ||
type ErrFunctionAlreadyRegistered struct { | ||
ID ID | ||
} | ||
|
||
func (e ErrFunctionAlreadyRegistered) Error() string { | ||
return fmt.Sprintf("Function %q already registered.", string(e.ID)) | ||
} | ||
|
||
// ErrFunctionValidation occurs when function payload doesn't validate. | ||
type ErrFunctionValidation struct { | ||
Message string | ||
} | ||
|
||
func (e ErrFunctionValidation) Error() string { | ||
return fmt.Sprintf("Function doesn't validate. Validation error: %q", e.Message) | ||
} | ||
|
||
// ErrFunctionCallFailed occurs when function call failed because of provider error. | ||
type ErrFunctionCallFailed struct { | ||
original error | ||
Original error | ||
} | ||
|
||
func (e ErrFunctionCallFailed) Error() string { | ||
return fmt.Sprintf("Function call failed. Error: %q", e.original) | ||
return fmt.Sprintf("Function call failed. Error: %q", e.Original) | ||
} | ||
|
||
// ErrFunctionProviderError occurs when function call failed because of provider error. | ||
type ErrFunctionProviderError struct { | ||
original error | ||
Original error | ||
} | ||
|
||
func (e ErrFunctionProviderError) Error() string { | ||
return fmt.Sprintf("Function call failed because of provider error. Error: %q", e.original) | ||
return fmt.Sprintf("Function call failed because of provider error. Error: %q", e.Original) | ||
} | ||
|
||
// ErrFunctionError occurs when function call failed because of function error. | ||
type ErrFunctionError struct { | ||
original error | ||
Original error | ||
} | ||
|
||
func (e ErrFunctionError) Error() string { | ||
return fmt.Sprintf("Function call failed because of runtime error. Error: %q", e.original) | ||
return fmt.Sprintf("Function call failed because of runtime error. Error: %q", e.Original) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.