(c *gin.Context, err error)
| 318 | } |
| 319 | |
| 320 | func 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 | |
| 337 | func dealErrorPage(c *gin.Context, err error) bool { |
| 338 | if err == nil { |
no test coverage detected