<commit_before>using System;
using Anotar.NLog;
using HipchatApiV2;
using HipchatApiV2.Enums;
using HipchatApiV2.Exceptions;

namespace SOVND.Server.Utils
{
    public static class HipchatSender
    {
        private static readonly HipchatClient _hipchat;

        static HipchatSender()
        {
            _hipchat = new HipchatClient();
        }

        public static void SendNotification(string roomName, string message, RoomColors color)
        {
            retry:
            try
            {
                _hipchat.SendNotification(roomName, message, color);
            }
            catch (HipchatWebException e) if (e.Message.Contains("404"))
            {
                _hipchat.CreateRoom(roomName, false, null, RoomPrivacy.Private);
                goto retry;
            }
            catch (HipchatWebException e) if (e.Message.Contains("rate"))
            {
                // Fail silently
            }
            catch (Exception e)
            {
                LogTo.ErrorException("Hipchat error", e);
            }
        }
    }
}<commit_msg>Correctly catch Hipchat room not found error<commit_after>using System;
using Anotar.NLog;
using HipchatApiV2;
using HipchatApiV2.Enums;
using HipchatApiV2.Exceptions;

namespace SOVND.Server.Utils
{
    public static class HipchatSender
    {
        private static readonly HipchatClient _hipchat;

        static HipchatSender()
        {
            _hipchat = new HipchatClient();
        }

        public static void SendNotification(string roomName, string message, RoomColors color)
        {
            retry:
            try
            {
                _hipchat.SendNotification(roomName, message, color);
            }
            catch (HipchatWebException e) if (e.Message.Contains("Room not found"))
            {
                _hipchat.CreateRoom(roomName, false, null, RoomPrivacy.Private);
                goto retry;
            }
            catch (HipchatWebException e) if (e.Message.Contains("rate"))
            {
                // Fail silently
            }
            catch (Exception e)
            {
                LogTo.Error("Hipchat error: {0}- {1}\r\n{2}", e.GetType().ToString(), e.Message, e.StackTrace);
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.08576480990274093, 'fraction_numerical': 0.005305039787798408, 'mean_word_length': 1.6623529411764706, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3849734', 'n_tokens_mistral': 631, 'n_tokens_neox': 603, 'n_words': 140}