add custom exception handling to oauth