* Registers the Github AcocuntSuspended & RepositoryUnavailable errors Adds the above-mentioned errors to the list of known errors raised by Octokit as to make possible for the rest of the application to specifically trap those. * Makes the RepoSyncWorker error handling rely on types The current implementation attempted to parse the error message to determine if the error reported by Github's API can/should be handled, this commit changes the implementation so that the exception type is used instead.
27 lines
404 B
Ruby
27 lines
404 B
Ruby
module Github
|
|
module Errors
|
|
class Error < StandardError
|
|
end
|
|
|
|
class ClientError < Error
|
|
end
|
|
|
|
class ServerError < Error
|
|
end
|
|
|
|
class NotFound < ClientError
|
|
end
|
|
|
|
class Unauthorized < ClientError
|
|
end
|
|
|
|
class InvalidRepository < ArgumentError
|
|
end
|
|
|
|
class AccountSuspended < ClientError
|
|
end
|
|
|
|
class RepositoryUnavailable < ClientError
|
|
end
|
|
end
|
|
end
|