Initial commit
This commit is contained in:
21
pjvm/exceptions.py
Normal file
21
pjvm/exceptions.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from .opcodes import INSTRUCTIONS
|
||||
|
||||
|
||||
class PJVMException(ValueError):
|
||||
pass
|
||||
|
||||
|
||||
class PJVMUnknownOpcode(PJVMException):
|
||||
def __init__(self, opcode: int):
|
||||
super(PJVMUnknownOpcode, self).__init__(f"OPCODE {opcode} -> {INSTRUCTIONS[opcode]['name']} not implemented")
|
||||
|
||||
|
||||
class PJVMNotImplemented(PJVMException):
|
||||
pass
|
||||
|
||||
|
||||
class PJVMTypeError(PJVMException):
|
||||
pass
|
||||
|
||||
|
||||
__all__ = ['PJVMException', 'PJVMUnknownOpcode', 'PJVMNotImplemented', 'PJVMTypeError']
|
||||
Reference in New Issue
Block a user