Files
LaDOSE/LaDOSE.Src/LaDOSE.Service/Provider/SheetsProvider/DisabledSheetsWriter.cs
T
darkstack 937b8554dd
Build App / Build (push) Failing after 3s
Docker Compose bot + Google Api
2026-08-06 16:23:50 +02:00

26 lines
908 B
C#

using System.Threading;
using System.Threading.Tasks;
using LaDOSE.Business.Interface;
using LaDOSE.Entity;
namespace LaDOSE.Business.Provider.SheetsProvider
{
/// <summary>
/// The default when GoogleSheets:Writer names nothing usable. Reports itself as
/// unconfigured so the API answers 503 with a message the user can act on, rather than
/// throwing a NullReferenceException that reaches the browser as an HTML developer page.
/// </summary>
public class DisabledSheetsWriter : ISheetsWriter
{
public string Name => "Disabled";
public bool IsConfigured => false;
public Task<SheetExportResult> WriteTablesAsync(SheetExportRequest request, CancellationToken ct = default)
{
throw new SheetsExportException(503,
"Google Sheets export is not configured on the server. Set GoogleSheets:Writer.");
}
}
}