isomerpages / isomercms-backend

A static website builder and host for the Singapore Government
5 stars 1 forks source link

fix(review): add empty string when 404 #791

Closed seaerchin closed 1 year ago

seaerchin commented 1 year ago

Problem

Previously, when we were retrieving files from github, we ran into 404s under 2 conditions:

  1. file didn't exist previously (in master) but did now (in staging)
  2. file existed previously (in master) but doesn't now (in staging).

because we rely on a GET request to github for both of staging/master, under either 1 of the above conditions, we will get a 404 which will in turn translate into a 500 on our end.

Solution

  1. This fixes the issue by adding a default empty string return when it is a 404 error
    • the case where the file didn't exist previously + didn't exist now means that it won't be raised for comparison anyway.