Re-add custom exception handling