File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ module Fcm
4+ # Custom Fcm errors
5+ class Error < StandardError
6+ ERROR_RESPONSE_400 = 'Only applies for JSON requests.' \
7+ ' Indicates that the request could not be parsed as JSON,' \
8+ ' or it contained invalid fields.'
9+
10+ ERROR_RESPONSE_401 = 'There was an error authenticating' \
11+ ' the sender account.'
12+
13+ ERROR_RESPONSE_503 = 'Server is temporarily unavailable.'
14+
15+ ERROR_RESPONSE_50X = 'There was an internal error in the' \
16+ ' FCM server while trying to process the request.'
17+ end
18+
19+ # Raised on errors in the 400-499 range
20+ class ClientError < Error ; end
21+
22+ # Raised when Faraday returns a 400 HTTP status code
23+ class BadRequest < ClientError ; end
24+
25+ # Raised when Faraday returns a 401 HTTP status code
26+ class Unauthorized < ClientError ; end
27+
28+ # Raised on errors in the 500-599 range
29+ class ServerError < Error ; end
30+
31+ # Raised when Faraday returns a 503 HTTP status code
32+ class ServiceUnavailable < ServerError ; end
33+ end
You can’t perform that action at this time.
0 commit comments