You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kstola2 edited this page Jun 22, 2019
·
5 revisions
Errors
Returning custom errors from your functions is a way of identifying the root of undesired behaviour. If there is a case in your function that checks for errors, make sure to return it with the following format:
if err != nil {
errors.New("Failed to do the thing:\n" + err.Error())
}
This will allow us to build our own stack trace which is great for debugging.