Monorepo for Tangled tangled.org

appview: strings: return 404 page if string wasnt found #430

merged opened by ptr.pet targeting master from [deleted fork]: strings-404
Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:dfl62fgb7wtjj3fcbb72naae/sh.tangled.repo.pull/3lvxph5ottr22
+5
Diff #0
+5
appview/strings/strings.go
··· 99 99 w.WriteHeader(http.StatusInternalServerError) 100 100 return 101 101 } 102 + if len(strings) < 1 { 103 + l.Error("string not found") 104 + s.Pages.Error404(w) 105 + return 106 + } 102 107 if len(strings) != 1 { 103 108 l.Error("incorrect number of records returned", "len(strings)", len(strings)) 104 109 w.WriteHeader(http.StatusInternalServerError)

History

1 round 1 comment
sign up or login to add to the discussion
ptr.pet submitted #0
1 commit
expand
c704e1cc
appview: strings: return 404 page if string wasnt found
expand 1 comment

lgtm, although its probably nicer to == 0

pull request successfully merged