Don't 500
This commit is contained in:
parent
1f043ed65f
commit
fd1dbf7798
@ -100,8 +100,12 @@ func DeletePanel(c *gin.Context) {
|
||||
|
||||
messageId, err := messageData.send(botContext, panels)
|
||||
if err != nil {
|
||||
_ = c.AbortWithError(http.StatusInternalServerError, app.NewServerError(err))
|
||||
return
|
||||
var unwrapped request.RestError
|
||||
if !errors.As(err, &unwrapped) || !unwrapped.IsClientError() {
|
||||
_ = c.AbortWithError(http.StatusInternalServerError, app.NewServerError(err))
|
||||
return
|
||||
}
|
||||
// TODO: nil message ID?
|
||||
}
|
||||
|
||||
if err := database.Client.MultiPanels.UpdateMessageId(c, multiPanel.Id, messageId); err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user