Add error handling to oauth controller