JavaRush
AI Academy
new
Promotion
Learning
Courses
Tasks
Quizzes
Games
Help
Schedule of nudges
Internship
Community
Users
Forum
Chat
Articles
Activities
Reviews
Subscriptions
Light theme

Lectures

  • Reviews
  • About us
  • CS50
Start
Start learning
Start learning
  • My progress
  • Courses
  • Quest map
  • Lectures
  • Error wrapping with %w and the cause chain

    Go SELF
    17 level,0 lecture
    In this lecture we will break down Go’s standard error wrapping mechanism: how adding context via %v differs from real wrapping via %w in fmt.Errorf, how the cause chain is structured, how errors.Unwrap works, and how to apply it in practice in a simple CLI. At the end, we’ll review typical mistakes when using wrapping.
    Open
  • errors.Is and errors.As

    Go SELF
    17 level,1 lecture
    We break down how to correctly check and classify errors in Go without parsing error text: why you should not build logic on err. Error(), how wrapping via "%w" works, how errors.Is (checking “that exact cause”) differs from errors.As (finding an error of the needed type and extracting details), and also common mistakes: comparing with == after wrapping, using "%v" instead of "%w", and passing & target incorrectly to errors.As.
    Open
  • Sentinel errors vs typed errors: how to choose

    Go SELF
    17 level,2 lecture
    In this lecture, we will cover two main “recognizable” approaches to errors in Go: sentinel (marker) errors and typed errors. We will learn how to design an error-handling contract using errors.Is and errors.As, discuss wrapping via fmt.Errorf with "%w", see the risks of “leaking implementation details”, and assemble a practical mixed design: sentinel class + typed cause (including via errors.Join).
    Open
  • errors.Join — joining multiple errors

    Go SELF
    17 level,3 lecture
    Let’s break down why in Go you sometimes need to return several errors at once, how errors.Join works (Go 1. 20+), why this is not “string concatenation” but a structured multi-error, and how it affects UX. We’ll build patterns for validation (with sentinel errors and context via fmt.Errorf using "%w") and for data import with accumulated per-line errors. We’ll also discuss how errors.Is/ errors.As keep working with joined errors, and what typical mistakes happen when using errors.Join.
    Open
  • Application error taxonomy

    Go SELF
    17 level,4 lecture
    Let's break down a practical approach to an error "taxonomy" in Go: how to выделить a small set of error classes (for example, validation/ notfound/ io/ internal), mark them with sentinel errors, wrap causes via %w, combine causes with labels via errors. Join, and choose top-level behavior using errors. Is.
    Open
Learn
  • Registration
  • Java course
  • Help with tasks
  • Pricing
  • Game projects
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Activities
Company
  • About us
  • Contacts
  • Reviews
  • FAQ
  • Support
JavaRushJavaRush — is an interactive online course for learning Java programming from scratch. It contains 1200 practical tasks with one-click solution checking, the necessary minimum of theory on Java basics, and motivating features that help you complete the course: games, quizzes, interesting projects and articles on effective learning and the career of a Java developer.
Follow us
Язык интерфейса
Русский
English
Українська
"Programmers are not born" © 2026 JavaRush
MastercardVisa
"Programmers are not born" © 2026 JavaRush