errorHandling.js 486 B

123456789101112131415161718
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. function tryFunctionOrLogError(f) {
  4. try {
  5. return f();
  6. }
  7. catch (e) {
  8. if (console.error) {
  9. console.error(e);
  10. }
  11. }
  12. }
  13. exports.tryFunctionOrLogError = tryFunctionOrLogError;
  14. function graphQLResultHasError(result) {
  15. return result.errors && result.errors.length;
  16. }
  17. exports.graphQLResultHasError = graphQLResultHasError;
  18. //# sourceMappingURL=errorHandling.js.map