I faced this problem while rescuing Twitter Errors :
NameError: uninitialized constant Twitter::Error::RequestEntityTooLarge
Error happened in production, and the same error occurs when I enter Twitter::Error::RequestEntityTooLarge in console.
I was rescuing errors that way : (I got the errors list from the documentation).
rescue Twitter::Error::BadRequest => e
raise BadRequestError.new(e)
rescue Twitter::Error::Unauthorized => e
raise AuthenticationError.new(e)
rescue Twitter::Error::Forbidden, Twitter::Error::NotFound, Twitter::Error::NotAcceptable,
Twitter::Error::RequestEntityTooLarge, Twitter::Error::UnprocessableEntity, Twitter::Error::TooManyRequests,
Twitter::Error::InternalServerError, Twitter::Error::BadGateway, Twitter::Error::ServiceUnavailable,
Twitter::Error::GatewayTimeout, Twitter::Error::DuplicateStatus, Twitter::Error::AlreadyFavorited,
Twitter::Error::AlreadyRetweeted, Twitter::Error::AlreadyRetweeted => e
raise PublicationError.new(e)
end
Now I'll rather rescue this way to avoid the issue :
rescue Twitter::Error::BadRequest => e
raise BadRequestError.new(e)
rescue Twitter::Error::Unauthorized => e
raise AuthenticationError.new(e)
rescue Twitter::Error::ClientError, Twitter::Error::ServerError => e
raise PublicationError.new(e)
end
Hello,
I faced this problem while rescuing Twitter Errors :
NameError: uninitialized constant Twitter::Error::RequestEntityTooLarge
Error happened in production, and the same error occurs when I enterTwitter::Error::RequestEntityTooLarge
in console.From what I saw the constant is defined as well as other errors in twitter/lib/twitter/error.rb
Anyone faced the same issue ?
I was rescuing errors that way : (I got the errors list from the documentation).
Now I'll rather rescue this way to avoid the issue :