MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / dealError

Function dealError

server/handles/sharing.go:320–335  ·  view source on GitHub ↗
(c *gin.Context, err error)

Source from the content-addressed store, hash-verified

318}
319
320func dealError(c *gin.Context, err error) bool {
321 if err == nil {
322 return false
323 } else if errors.Is(err, errs.SharingNotFound) {
324 common.ErrorStrResp(c, "the share does not exist", 500)
325 } else if errors.Is(err, errs.InvalidSharing) {
326 common.ErrorStrResp(c, "the share has expired or is no longer valid", 500)
327 } else if errors.Is(err, errs.WrongShareCode) {
328 common.ErrorResp(c, err, 403)
329 } else if errors.Is(err, errs.WrongArchivePassword) {
330 common.ErrorResp(c, err, 202)
331 } else {
332 common.ErrorResp(c, err, 500)
333 }
334 return true
335}
336
337func dealErrorPage(c *gin.Context, err error) bool {
338 if err == nil {

Callers 4

SharingGetFunction · 0.85
SharingListFunction · 0.85
SharingArchiveMetaFunction · 0.85
SharingArchiveListFunction · 0.85

Calls 2

ErrorStrRespFunction · 0.92
ErrorRespFunction · 0.92

Tested by

no test coverage detected