You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
368 B

  1. package common
  2. import (
  3. "errors"
  4. "fmt"
  5. )
  6. func Errorf(s string, args ...interface{}) error {
  7. return errors.New(fmt.Sprintf(s, args...))
  8. }
  9. type StackError struct {
  10. Err interface{}
  11. Stack []byte
  12. }
  13. func (se StackError) String() string {
  14. return fmt.Sprintf("Error: %v\nStack: %s", se.Err, se.Stack)
  15. }
  16. func (se StackError) Error() string {
  17. return se.String()
  18. }