﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SlackAPI
{
    public abstract class Response
    {
        /// <summary>
        /// Should always be checked before trying to process a response.
        /// </summary>
        public bool ok;

        /// <summary>
        /// if ok is false, then this is the reason-code
        /// </summary>
        public string error;

        public void AssertOk()
        {
            if (!(ok))
                throw new InvalidOperationException(string.Format("An error occurred: {0}", this.error));
        }
    }
}

﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SlackAPI
{
    public abstract class Response
    {
        /// <summary>
        /// Should always be checked before trying to process a response.
        /// </summary>
        public bool ok;

        /// <summary>
        /// if ok is false, then this is the reason-code
        /// </summary>
        public string error;
        public string needed;
        public string provided;

        public void AssertOk()
        {
            if (!(ok))
                throw new InvalidOperationException(string.Format("An error occurred: {0}", this.error));
        }
    }
}

Add the attribute needed, provided
Add the attribute needed, provided

Some time when we have a connection failure, the error message need some information, ex: missing_scope
So we need to know what are the "needed" scope to add them.
with provided we can see what are the permission that we already provided to app.