# Extend the standard message generation to accept our custom exceptiondeffailure_messageexception=env["omniauth.error"]ifexception.class==OmniAuth::Errorerror=exception.messageelseerror=exception.error_reasonifexception.respond_to?(:error_reason)error||=exception.errorifexception.respond_to?(:error)error||=env["omniauth.error.type"].to_senderror.to_s.humanizeiferrorend