Superteam Academy
|bySuperteam BrasilSuperteam Brasil
Superteam Academy

The decentralized learning platform for Solana developers.

Resources

  • Courses
  • Leaderboard
  • Community

Support

  • Documentation
  • API Reference
  • Community

Legal

  • Terms of Service
  • Privacy Policy
  • Cookie Policy

Follow Us

  • Twitter / X
  • Discord
  • GitHub

Stay in the Loop

Get weekly updates on new courses, Solana ecosystem news, and learning tips.

Powered bySuperteam BrasilSuperteam Brasil

Β© 2026 Superteam Academy. All rights reserved.

Anchor Framework Fundamentals

PDA Constraints
Error Handling
Testing with Anchor
Build Your First Program
Advanced Anchor / Error Handling
30 XP

Error Handling

Custom Errors

Rust
#[error_code]
pub enum ErrorCode {
    #[msg("Course is not active")]
    CourseNotActive,
    #[msg("Already enrolled")]
    AlreadyEnrolled,
    #[msg("Insufficient XP")]
    InsufficientXP,
}

Use with: require!(course.is_active, ErrorCode::CourseNotActive);

You need to enroll in this course before you can mark lessons as complete.
6 / 8