Exemple #1
0
        public DiscordHttpException(DiscordHttpError error) : base($"{(int)error.Code} {error.Message}")
        {
            Code         = error.Code;
            ErrorMessage = error.Message;

            if (error.Fields != null)
            {
                InvalidFields = FindErrors(error.Fields);
            }
        }
Exemple #2
0
        internal DiscordHttpException(DiscordHttpError error) : base($"{(int)error.Code} {error.Message}")
        {
            Code         = error.Code;
            ErrorMessage = error.Message;

            InvalidParameters = new Dictionary <string, IReadOnlyList <InvalidParameter> >();

            if (error.Fields != null)
            {
                foreach (var field in error.Fields)
                {
                    InvalidParameters[field.Key] = field.Value.Fields;
                }
            }
        }