mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Greenfield: Improve error message, do not use internal lightning node on store's lightning API
This commit is contained in:
21
BTCPayServer/Filters/JsonHttpExceptionFilter.cs
Normal file
21
BTCPayServer/Filters/JsonHttpExceptionFilter.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using Microsoft.AspNetCore.Mvc.Infrastructure;
|
||||
|
||||
namespace BTCPayServer.Filters
|
||||
{
|
||||
public class JsonHttpExceptionFilter : IExceptionFilter
|
||||
{
|
||||
public void OnException(ExceptionContext context)
|
||||
{
|
||||
if (context.Exception is JsonHttpException ex)
|
||||
{
|
||||
context.Result = ex.ActionResult;
|
||||
context.ExceptionHandled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user