Return the lowest-level DropboxError. This can be used when reporting the stack of the original exception to try and get the most relevant stack instead of the highest level stack.
(dbxErr DropboxError)
| 235 | // reporting the stack of the original exception to try and get the most |
| 236 | // relevant stack instead of the highest level stack. |
| 237 | func RootDropboxError(dbxErr DropboxError) DropboxError { |
| 238 | for { |
| 239 | innerErr := dbxErr.Unwrap() |
| 240 | if innerErr == nil { |
| 241 | break |
| 242 | } |
| 243 | innerDBXErr, ok := innerErr.(DropboxError) |
| 244 | if !ok { |
| 245 | break |
| 246 | } |
| 247 | dbxErr = innerDBXErr |
| 248 | } |
| 249 | return dbxErr |
| 250 | } |
| 251 | |
| 252 | // Perform a deep check, unwrapping errors as much as possilbe and |
| 253 | // comparing the string version of the error. |