FIX: Uploading File With Unkown Catagory Id
Build, Push and Deploy CMS / build-push-deploy (push) Successful in 2m22s

This commit is contained in:
FahdShalhoub
2026-08-27 18:43:04 +03:00
parent ae129c8f61
commit b68086eea4
5 changed files with 51 additions and 9 deletions
+16
View File
@@ -0,0 +1,16 @@
package handlers
import "errors"
// Sentinel errors the handlers branch on with errors.Is to decide which
// problem response a failure deserves. They exist to separate a client's
// mistake from a server fault where the code that detects both is the same
// code — the repositories return plain errors, so without these every failure
// out of a lookup would have to be answered as a 500.
// errUnknownCatagoryID reports that a submitted category id is not in the
// category table. It is kept distinct from the error the lookup itself
// returns because the two are not the same kind of failure: an id nobody has
// is the client's mistake and answers 404, while a lookup that could not run
// is the server's and answers 500.
var errUnknownCatagoryID = errors.New("unknown catagory id")