How to use the bs-platform/lib/js/js_exn.js.raiseError function in bs-platform

To help you get started, we’ve selected a few bs-platform examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OneGraph / onegraph-examples / spotify-app / src / GetCurrentlyPlayingQuery.bs.js View on Github external
var match$14 = Js_json.decodeBoolean(value$6);
                        tmp$6 = match$14 !== undefined ? match$14 : Js_exn.raiseError("graphql_ppx: Expected boolean, got " + JSON.stringify(value$6));
                      }
                    } else {
                      tmp$6 = undefined;
                    }
                    var match$15 = Js_dict.get(value$5, "currentlyPlayingType");
                    var tmp$7;
                    if (match$15 !== undefined) {
                      var value$7 = Caml_option.valFromOption(match$15);
                      var match$16 = Js_json.decodeNull(value$7);
                      if (match$16 !== undefined) {
                        tmp$7 = undefined;
                      } else {
                        var match$17 = Js_json.decodeString(value$7);
                        tmp$7 = match$17 !== undefined ? match$17 : Js_exn.raiseError("graphql_ppx: Expected string, got " + JSON.stringify(value$7));
                      }
                    } else {
                      tmp$7 = undefined;
                    }
                    var match$18 = Js_dict.get(value$5, "item");
                    var tmp$8;
                    if (match$18 !== undefined) {
                      var value$8 = Caml_option.valFromOption(match$18);
                      var match$19 = Js_json.decodeNull(value$8);
                      if (match$19 !== undefined) {
                        tmp$8 = undefined;
                      } else {
                        var match$20 = Js_json.decodeObject(value$8);
                        var tmp$9;
                        if (match$20 !== undefined) {
                          var value$9 = Caml_option.valFromOption(match$20);
github OneGraph / onegraph-examples / spotify-app / src / GetCurrentlyPlayingQuery.bs.js View on Github external
var match$23 = Js_json.decodeString(value$10);
                              tmp$10 = match$23 !== undefined ? match$23 : Js_exn.raiseError("graphql_ppx: Expected string, got " + JSON.stringify(value$10));
                            }
                          } else {
                            tmp$10 = undefined;
                          }
                          var match$24 = Js_dict.get(value$9, "name");
                          var tmp$11;
                          if (match$24 !== undefined) {
                            var value$11 = Caml_option.valFromOption(match$24);
                            var match$25 = Js_json.decodeNull(value$11);
                            if (match$25 !== undefined) {
                              tmp$11 = undefined;
                            } else {
                              var match$26 = Js_json.decodeString(value$11);
                              tmp$11 = match$26 !== undefined ? match$26 : Js_exn.raiseError("graphql_ppx: Expected string, got " + JSON.stringify(value$11));
                            }
                          } else {
                            tmp$11 = undefined;
                          }
                          var match$27 = Js_dict.get(value$9, "artists");
                          var tmp$12;
                          if (match$27 !== undefined) {
                            var value$12 = Caml_option.valFromOption(match$27);
                            var match$28 = Js_json.decodeNull(value$12);
                            if (match$28 !== undefined) {
                              tmp$12 = undefined;
                            } else {
                              var match$29 = Js_json.decodeArray(value$12);
                              tmp$12 = match$29 !== undefined ? match$29.map((function (value) {
                                        var match = Js_json.decodeObject(value);
                                        if (match !== undefined) {
github OneGraph / onegraph-examples / spotify-app / src / GetCurrentlyPlayingQuery.bs.js View on Github external
tmp$17 = match$41 !== undefined ? match$41.map((function (value) {
                                              var match = Js_json.decodeObject(value);
                                              if (match !== undefined) {
                                                var match$1 = Js_dict.get(Caml_option.valFromOption(match), "url");
                                                var tmp;
                                                if (match$1 !== undefined) {
                                                  var value$1 = Caml_option.valFromOption(match$1);
                                                  var match$2 = Js_json.decodeNull(value$1);
                                                  if (match$2 !== undefined) {
                                                    tmp = undefined;
                                                  } else {
                                                    var match$3 = Js_json.decodeString(value$1);
                                                    tmp = match$3 !== undefined ? match$3 : Js_exn.raiseError("graphql_ppx: Expected string, got " + JSON.stringify(value$1));
                                                  }
                                                } else {
                                                  tmp = undefined;
                                                }
                                                return {
                                                        url: tmp
                                                      };
                                              } else {
                                                return Js_exn.raiseError("graphql_ppx: Object is not a value");
                                              }
                                            })) : Js_exn.raiseError("graphql_ppx: Expected array, got " + JSON.stringify(value$16));
                                  }
github OneGraph / onegraph-examples / spotify-app / src / GetCurrentlyPlayingQuery.bs.js View on Github external
}
                                      })) : Js_exn.raiseError("graphql_ppx: Expected array, got " + JSON.stringify(value$12));
                            }
                          } else {
                            tmp$12 = undefined;
                          }
                          var match$30 = Js_dict.get(value$9, "durationMs");
                          var tmp$13;
                          if (match$30 !== undefined) {
                            var value$13 = Caml_option.valFromOption(match$30);
                            var match$31 = Js_json.decodeNull(value$13);
                            if (match$31 !== undefined) {
                              tmp$13 = undefined;
                            } else {
                              var match$32 = Js_json.decodeNumber(value$13);
                              tmp$13 = match$32 !== undefined ? match$32 | 0 : Js_exn.raiseError("graphql_ppx: Expected int, got " + JSON.stringify(value$13));
                            }
                          } else {
                            tmp$13 = undefined;
                          }
                          var match$33 = Js_dict.get(value$9, "href");
                          var tmp$14;
                          if (match$33 !== undefined) {
                            var value$14 = Caml_option.valFromOption(match$33);
                            var match$34 = Js_json.decodeNull(value$14);
                            if (match$34 !== undefined) {
                              tmp$14 = undefined;
                            } else {
                              var match$35 = Js_json.decodeString(value$14);
                              tmp$14 = match$35 !== undefined ? match$35 : Js_exn.raiseError("graphql_ppx: Expected string, got " + JSON.stringify(value$14));
                            }
                          } else {
github OneGraph / onegraph-examples / spotify-app / src / GetCurrentlyPlayingQuery.bs.js View on Github external
} else {
              tmp$2 = Js_exn.raiseError("graphql_ppx: Object is not a value");
            }
            tmp$1 = Caml_option.some(tmp$2);
          }
        } else {
          tmp$1 = undefined;
        }
        tmp = {
          me: tmp$1
        };
      } else {
        tmp = Js_exn.raiseError("graphql_ppx: Object is not a value");
      }
    } else {
      tmp = Js_exn.raiseError("graphql_ppx: Field spotify on type Query is missing");
    }
    return {
            spotify: tmp
          };
  } else {
    return Js_exn.raiseError("graphql_ppx: Object is not a value");
  }
}
github OneGraph / onegraph-examples / spotify-app / src / GetCurrentlyPlayingQuery.bs.js View on Github external
var value$1 = Caml_option.valFromOption(match$1);
                                            var match$2 = Js_json.decodeNull(value$1);
                                            if (match$2 !== undefined) {
                                              tmp = undefined;
                                            } else {
                                              var match$3 = Js_json.decodeString(value$1);
                                              tmp = match$3 !== undefined ? match$3 : Js_exn.raiseError("graphql_ppx: Expected string, got " + JSON.stringify(value$1));
                                            }
                                          } else {
                                            tmp = undefined;
                                          }
                                          return {
                                                  name: tmp
                                                };
                                        } else {
                                          return Js_exn.raiseError("graphql_ppx: Object is not a value");
                                        }
                                      })) : Js_exn.raiseError("graphql_ppx: Expected array, got " + JSON.stringify(value$12));
                            }
github OneGraph / onegraph-examples / spotify-app / src / GetUsername.bs.js View on Github external
tmp$1 = undefined;
        }
        tmp = {
          spotify: tmp$1
        };
      } else {
        tmp = Js_exn.raiseError("graphql_ppx: Object is not a value");
      }
    } else {
      tmp = Js_exn.raiseError("graphql_ppx: Field me on type Query is missing");
    }
    return {
            me: tmp
          };
  } else {
    return Js_exn.raiseError("graphql_ppx: Object is not a value");
  }
}
github OneGraph / onegraph-examples / spotify-app / src / GetCurrentlyPlayingQuery.bs.js View on Github external
tmp$4 = undefined;
                } else {
                  var match$11 = Js_json.decodeObject(value$4);
                  var tmp$5;
                  if (match$11 !== undefined) {
                    var value$5 = Caml_option.valFromOption(match$11);
                    var match$12 = Js_dict.get(value$5, "isPlaying");
                    var tmp$6;
                    if (match$12 !== undefined) {
                      var value$6 = Caml_option.valFromOption(match$12);
                      var match$13 = Js_json.decodeNull(value$6);
                      if (match$13 !== undefined) {
                        tmp$6 = undefined;
                      } else {
                        var match$14 = Js_json.decodeBoolean(value$6);
                        tmp$6 = match$14 !== undefined ? match$14 : Js_exn.raiseError("graphql_ppx: Expected boolean, got " + JSON.stringify(value$6));
                      }
                    } else {
                      tmp$6 = undefined;
                    }
                    var match$15 = Js_dict.get(value$5, "currentlyPlayingType");
                    var tmp$7;
                    if (match$15 !== undefined) {
                      var value$7 = Caml_option.valFromOption(match$15);
                      var match$16 = Js_json.decodeNull(value$7);
                      if (match$16 !== undefined) {
                        tmp$7 = undefined;
                      } else {
                        var match$17 = Js_json.decodeString(value$7);
                        tmp$7 = match$17 !== undefined ? match$17 : Js_exn.raiseError("graphql_ppx: Expected string, got " + JSON.stringify(value$7));
                      }
                    } else {
github OneGraph / onegraph-examples / spotify-app / src / GetUsername.bs.js View on Github external
var match$8 = Js_json.decodeString(value$3);
                  tmp$3 = match$8 !== undefined ? match$8 : Js_exn.raiseError("graphql_ppx: Expected string, got " + JSON.stringify(value$3));
                }
              } else {
                tmp$3 = undefined;
              }
              var match$9 = Js_dict.get(value$2, "displayName");
              var tmp$4;
              if (match$9 !== undefined) {
                var value$4 = Caml_option.valFromOption(match$9);
                var match$10 = Js_json.decodeNull(value$4);
                if (match$10 !== undefined) {
                  tmp$4 = undefined;
                } else {
                  var match$11 = Js_json.decodeString(value$4);
                  tmp$4 = match$11 !== undefined ? match$11 : Js_exn.raiseError("graphql_ppx: Expected string, got " + JSON.stringify(value$4));
                }
              } else {
                tmp$4 = undefined;
              }
              tmp$2 = {
                id: tmp$3,
                displayName: tmp$4
              };
            } else {
              tmp$2 = Js_exn.raiseError("graphql_ppx: Object is not a value");
            }
            tmp$1 = Caml_option.some(tmp$2);
          }
        } else {
          tmp$1 = undefined;
        }
github OneGraph / onegraph-examples / spotify-app / src / GetCurrentlyPlayingQuery.bs.js View on Github external
var match$32 = Js_json.decodeNumber(value$13);
                              tmp$13 = match$32 !== undefined ? match$32 | 0 : Js_exn.raiseError("graphql_ppx: Expected int, got " + JSON.stringify(value$13));
                            }
                          } else {
                            tmp$13 = undefined;
                          }
                          var match$33 = Js_dict.get(value$9, "href");
                          var tmp$14;
                          if (match$33 !== undefined) {
                            var value$14 = Caml_option.valFromOption(match$33);
                            var match$34 = Js_json.decodeNull(value$14);
                            if (match$34 !== undefined) {
                              tmp$14 = undefined;
                            } else {
                              var match$35 = Js_json.decodeString(value$14);
                              tmp$14 = match$35 !== undefined ? match$35 : Js_exn.raiseError("graphql_ppx: Expected string, got " + JSON.stringify(value$14));
                            }
                          } else {
                            tmp$14 = undefined;
                          }
                          var match$36 = Js_dict.get(value$9, "album");
                          var tmp$15;
                          if (match$36 !== undefined) {
                            var value$15 = Caml_option.valFromOption(match$36);
                            var match$37 = Js_json.decodeNull(value$15);
                            if (match$37 !== undefined) {
                              tmp$15 = undefined;
                            } else {
                              var match$38 = Js_json.decodeObject(value$15);
                              var tmp$16;
                              if (match$38 !== undefined) {
                                var match$39 = Js_dict.get(Caml_option.valFromOption(match$38), "images");