This returns the error string without stack trace information.
(err interface{})
| 62 | |
| 63 | // This returns the error string without stack trace information. |
| 64 | func GetMessage(err interface{}) string { |
| 65 | switch e := err.(type) { |
| 66 | case DropboxError: |
| 67 | return extractFullErrorMessage(e, false) |
| 68 | case runtime.Error: |
| 69 | return runtime.Error(e).Error() |
| 70 | case error: |
| 71 | return e.Error() |
| 72 | default: |
| 73 | return "Passed a non-error to GetMessage" |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | // This returns a string with all available error information, including inner |
| 78 | // errors that are wrapped by this errors. |