db: Refactor switch; NFC
此提交包含在:
@@ -73,11 +73,7 @@ func ErrHTTPStatusCode(err error) int {
|
||||
switch err {
|
||||
case nil:
|
||||
return 0
|
||||
case ErrKeyInvalidChar:
|
||||
return http.StatusNotFound
|
||||
case ErrKeyInvalidLength:
|
||||
return http.StatusNotFound
|
||||
case ErrPasteDoesNotExist:
|
||||
case ErrKeyInvalidChar, ErrKeyInvalidLength, ErrPasteDoesNotExist:
|
||||
return http.StatusNotFound
|
||||
}
|
||||
return http.StatusInternalServerError
|
||||
|
||||
新增問題並參考
封鎖使用者