mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
* Mention the missing API permission in the response header or body * Fixes + Added a unit test. 1 TODO remains. * Added MissingPermissionDescription to the error * Update BTCPayServer.Tests/GreenfieldAPITests.cs Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com> * Fix tests * [GreenField]: Make sure we are sending fully typed errors Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
18 lines
603 B
C#
18 lines
603 B
C#
using System;
|
|
|
|
namespace BTCPayServer.Client.Models
|
|
{
|
|
public class GreenfieldPermissionAPIError : GreenfieldAPIError
|
|
{
|
|
public GreenfieldPermissionAPIError(string missingPermission, string message = null) : base()
|
|
{
|
|
MissingPermission = missingPermission;
|
|
Code = "missing-permission";
|
|
Message = message ?? $"Insufficient API Permissions. Please use an API key with permission \"{MissingPermission}\". You can create an API key in your account's settings / Api Keys.";
|
|
}
|
|
|
|
public string MissingPermission { get; }
|
|
|
|
}
|
|
}
|