Improved error handling in MessageQueue

This commit is contained in:
RogueException
2016-01-18 23:03:13 -04:00
parent f581434497
commit 7e97596a5d

View File

@@ -155,7 +155,7 @@ namespace Discord.Net
};
await _client.ClientAPI.Send(request).ConfigureAwait(false);
}
catch (Exception ex) { msg.State = MessageState.Failed; _logger.Error("Failed to edit message", ex); }
catch (Exception ex) { _logger.Error("Failed to edit message", ex); }
}
}
internal async Task Delete(Message msg)
@@ -167,7 +167,8 @@ namespace Discord.Net
var request = new DeleteMessageRequest(msg.Channel.Id, msg.Id);
await _client.ClientAPI.Send(request).ConfigureAwait(false);
}
catch (Exception ex) { msg.State = MessageState.Failed; _logger.Error("Failed to delete message", ex); }
catch (HttpException ex) when (ex.StatusCode == HttpStatusCode.NotFound) { } //Ignore
catch (Exception ex) { _logger.Error("Failed to delete message", ex); }
}
}