YoVDO

Working with Errors

Offered By: Gopher Academy via YouTube

Tags

GopherCon Courses

Course Description

Overview

Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Explore the intricacies of error handling in Go 1.13 through this GopherCon 2020 talk by Jonathan Amsterdam. Dive into the concept of wrapped errors, understanding when and how to use them effectively. Learn about the new functions and formatting directive introduced to support error wrapping, and their impact on error return and handling practices. Discover techniques for incorporating additional features like stack traces, error codes, and custom formatting into your error packages. Gain insights on best practices for annotating errors, using the errors.As function, and implementing user-facing error handling. Examine the challenges and considerations in moving to wrapped errors, including potential pitfalls and formatting issues. Enhance your Go programming skills with practical examples and expert guidance on working with errors in modern Go development.

Syllabus

Intro
Wrapping and the error chain
Error-wrapping support in Go 1.13
Two audiences for errors
A Config struct
Returning errors unadorned
User-facing function
Deciding with errors before 1.13
Annotating errors
Error wrapping
Wrapping errors in Go 1.13
Use errors. As instead of type assertions
Under the hood
Moving to Wrapped Errors
Wrapping Returned Errors
Did we go too far?
Errors and Codes
Stack trace example
Stack trace problems
We tried...
How we don't do it
Execution Traces With Wrap
Standard Formatting
Detailed Formatting
Formatting Removed
Detail Formatting with fmt. Formatter
References


Taught by

Gopher Academy

Related Courses

A Holistic Go Experience
Gopher Academy via YouTube
Safe, Fast, and Easy - Building a Plugin System with WebAssembly
Gopher Academy via YouTube
A Journey Through Integration Testing with Go - What Could Go Wrong?
Gopher Academy via YouTube
Kraken Wrangling for Dummies - Go Module Dependency Management at Scale
Gopher Academy via YouTube
Go, the Data Engineer's Missing Tool?
Gopher Academy via YouTube