How to use the @shopify/react-network.StatusCode.InternalServerError function in @shopify/react-network

To help you get started, we’ve selected a few @shopify/react-network 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 Shopify / quilt / packages / react-server / src / render / render.tsx View on Github external
]);

      const response = stream(
        
          {app}
        ,
      );

      ctx.set(Header.ContentType, 'text/html');
      ctx.body = response;
    } catch (error) {
      const errorMessage = `React server-side rendering error:\n${error.stack ||
        error.message}`;

      logger.log(errorMessage);
      ctx.status = StatusCode.InternalServerError;

      // eslint-disable-next-line no-process-env
      if (process.env.NODE_ENV === 'development') {
        ctx.body = errorMessage;
      } else {
        ctx.throw(StatusCode.InternalServerError, error);
      }
    }
  }
github Shopify / quilt / packages / react-server / src / render / render.tsx View on Github external
);

      ctx.set(Header.ContentType, 'text/html');
      ctx.body = response;
    } catch (error) {
      const errorMessage = `React server-side rendering error:\n${error.stack ||
        error.message}`;

      logger.log(errorMessage);
      ctx.status = StatusCode.InternalServerError;

      // eslint-disable-next-line no-process-env
      if (process.env.NODE_ENV === 'development') {
        ctx.body = errorMessage;
      } else {
        ctx.throw(StatusCode.InternalServerError, error);
      }
    }
  }

@shopify/react-network

A collection of components that allow you to set common HTTP headers from within your React application

MIT
Latest version published 3 months ago

Package Health Score

53 / 100
Full package analysis

Similar packages