ddd-refactor #2

Merged
mz merged 46 commits from ddd-refactor into main 2025-11-28 11:14:43 +01:00
Showing only changes of commit 62cf71eaa8 - Show all commits

View File

@@ -31,8 +31,25 @@ public class GoogleSheetsHelper
var json = Environment.GetEnvironmentVariable("GOOGLE_SERVICE_ACCOUNT_JSON");
if (string.IsNullOrWhiteSpace(json))
throw new InvalidOperationException("GOOGLE_SERVICE_ACCOUNT_JSON environment variable is not set.");
Console.WriteLine($"[GoogleSheetsHelper] Original JSON length: {json.Length}");
Console.WriteLine($"[GoogleSheetsHelper] First 200 chars: {json.Substring(0, Math.Min(200, json.Length))}");
// Replace literal \n with actual newlines
json = json.Replace("\\n", "\n");
Console.WriteLine($"[GoogleSheetsHelper] After replacement, first 200 chars: {json.Substring(0, Math.Min(200, json.Length))}");
try
{
return GoogleCredential.FromJson(json).CreateScoped(Scopes);
}
catch (Exception ex)
{
Console.WriteLine($"[GoogleSheetsHelper] ERROR parsing JSON: {ex.Message}");
Console.WriteLine($"[GoogleSheetsHelper] JSON being parsed: {json}");
throw;
}
#endif
}
}