@@ -193,7 +193,7 @@ module Response = struct
193193 module Results = struct
194194 (* If an error occurred, one of these sum types is returned (based on the
195195 couple (code, error_as_string), see [error_of_string_and_code].
196- *)
196+ *)
197197 type error =
198198 | Missing_registration
199199 | Invalid_registration
@@ -214,7 +214,7 @@ module Response = struct
214214 (* Internal use. See
215215 https://developers.google.com/cloud-messaging/http-server-ref
216216 table 9
217- *)
217+ *)
218218 let error_of_string_and_code = function
219219 | 200 , "MissingRegistration" -> Missing_registration
220220 | 200 , "InvalidRegistration" -> Invalid_registration
@@ -253,7 +253,7 @@ module Response = struct
253253
254254 (* If no error occurred, the JSON in the results attribute contains a
255255 mandatory field message_id and an optional field registration_id.
256- *)
256+ *)
257257 type success = {message_id : string ; registration_id : string option }
258258
259259 let message_id_of_success success = success.message_id
@@ -266,7 +266,7 @@ module Response = struct
266266 match Util. member " message_id" json with
267267 (* If the field [message_id] is present, we are in the case of a
268268 successful message
269- *)
269+ *)
270270 | `String x ->
271271 let message_id = x in
272272 let registration_id =
@@ -279,12 +279,12 @@ module Response = struct
279279 case of an error message.
280280 The pattern _ is used because is equivalent to `Null in this
281281 case due to the predefined type of the message_id (string).
282- *)
282+ *)
283283 | _ -> (
284284 match Util. member " error" json with
285285 (* If the field [error] is present, we are in the case of an
286286 error message.
287- *)
287+ *)
288288 | `String err -> Error (error_of_string_and_code (code, err))
289289 (* Else we don't know what is the result. *)
290290 | _ -> raise (FCM_missing_field " No message_id and error fields found." )
@@ -307,7 +307,7 @@ module Response = struct
307307 the max integer. The first pattern is `Int x is x is smaller
308308 than the max integer and the second is `String if x can't be
309309 interpreted as an integer.
310- *)
310+ *)
311311 let multicast_id =
312312 match Util. member " multicast_id" json with
313313 | `Int x -> string_of_int x
@@ -331,7 +331,7 @@ module Response = struct
331331 in
332332 (* As results is an options array, we don't fail if it's not present but
333333 we use an empty list.
334- *)
334+ *)
335335 let results =
336336 match Util. member " results" json with
337337 | `List l -> List. map (Results. t_of_json code) l
@@ -342,7 +342,7 @@ module Response = struct
342342 (* Build a type t from the raw HTTP response. The HTTP response code is
343343 computed to pass it to [t_of_json] and to [results_of_json] to be used
344344 if an error occurred.
345- *)
345+ *)
346346 let t_of_http_response (r , b ) =
347347 try % lwt
348348 let status = Cohttp. (Code. code_of_status (Response. status r)) in
@@ -352,7 +352,7 @@ module Response = struct
352352 with
353353 (* Could be the case if the server key is wrong or if it's not
354354 registered only in FCM and not in FCM (since September 2016).
355- *)
355+ *)
356356 | Yojson. Json_error _ ->
357357 Lwt. fail (FCM_no_json_response " It could come from your server key." )
358358
0 commit comments