From 9a49bc3a5f97f7484d84dc48b340fae0f37753c8 Mon Sep 17 00:00:00 2001 From: Juraj Skripsky Date: Tue, 21 Nov 2023 16:19:29 +0100 Subject: [PATCH] More debug output. --- src/Main.fs | 4 ++-- src/Ntfy.fs | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Main.fs b/src/Main.fs index 0bf7cc9..2e50106 100644 --- a/src/Main.fs +++ b/src/Main.fs @@ -32,8 +32,8 @@ module Main = ] let result = - if isNull secrets.GotCourts.ApiKey || isNull secrets.GotCourts.PhpSessionId then - log.Write (Error, "💥", sprintf "Please set environment variables '%s' and '%s'." apiKeyName phpSessionIdName) + if isNull secrets.GotCourts.ApiKey || isNull secrets.GotCourts.PhpSessionId || isNull secrets.NtfyTopic then + log.Write (Error, "💥", sprintf "Please set environment variables '%s', '%s', and '%s'." apiKeyName phpSessionIdName ntfyTopicName) 1 else try diff --git a/src/Ntfy.fs b/src/Ntfy.fs index df48add..154b0f4 100644 --- a/src/Ntfy.fs +++ b/src/Ntfy.fs @@ -15,8 +15,10 @@ module Ntfy = printfn "Posting text to ntfy.sh." let resp = client.PostAsync(url, sc) |> await - printfn "StatusCode: %A" resp.StatusCode if resp.StatusCode <> HttpStatusCode.OK then - printfn "Reason: %s" resp.ReasonPhrase + printfn "Error! Reason: %s" resp.ReasonPhrase + printfn "Length of topic name: %d chars." topic.Length + else + printfn "OK." ()