File size: 718 Bytes
02215ec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# eras_exceptions.py

class ErasLangError(Exception):
    """Base class for all ErasLang errors."""
    def __init__(self, message, line_no=None):
        self.line_no = line_no
        self.message = f"🎶 Performance Issue: {message}"
        if line_no:
            self.message += f" (at line {line_no})"
        super().__init__(self.message)

class BadBloodSyntaxError(ErasLangError):
    """Raised when the compiler finds lyrics it doesn't recognize."""
    pass

class ExileRuntimeError(ErasLangError):
    """Raised when the logic fails during execution (e.g., div by zero)."""
    pass

class VaultAccessError(ErasLangError):
    """Raised when calling a function that wasn't found in the vault."""
    pass