feat: add error handling in api handler
This commit is contained in:
@@ -16,6 +16,8 @@ func GetItem(cache *cache.Cache) echo.HandlerFunc {
|
||||
|
||||
if found {
|
||||
resp = fmt.Sprintf("%+v", cachedObj)
|
||||
} else {
|
||||
return c.String(http.StatusNotFound, "Key not found")
|
||||
}
|
||||
|
||||
return c.String(http.StatusOK, resp)
|
||||
|
Reference in New Issue
Block a user