Skip to content

Commit 70b64ba

Browse files
committed
stop throwing http error when endpoint is unreachable
1 parent 765160c commit 70b64ba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ func Pointer[T any](d T) *T {
6161
func handleSpaceApiV15(w http.ResponseWriter, r *http.Request) {
6262
labState, labStateLastChange, labStateError := fetchLabState()
6363
if labStateError != nil {
64-
http.Error(w, labStateError.Error(), http.StatusInternalServerError)
65-
return
64+
//http.Error(w, labStateError.Error(), http.StatusInternalServerError)
65+
spaceApiData.State.Open = nil
6666
} else {
6767
spaceApiData.State.Open = labState
6868
if labStateLastChange != nil {
@@ -79,7 +79,7 @@ func handleSpaceApiV15(w http.ResponseWriter, r *http.Request) {
7979
func fetchLabState() (*bool, *int64, error) {
8080
client := &http.Client{}
8181

82-
req, err := http.NewRequest("GET", "https://eingang.metalab.at/status.json", nil)
82+
req, err := http.NewRequest("GET", "https://eingang.metalaba.at/status.json", nil)
8383

8484
//req, err := http.NewRequest("GET", "http://localhost:3333/lab", nil)
8585
if err != nil {

0 commit comments

Comments
 (0)