Define custom exception classes
Implement attach/detach methods