From 6d206a98b5ce320600dd2e4ccee99117518be368 Mon Sep 17 00:00:00 2001 From: "John R. D'Orazio" Date: Wed, 22 May 2024 14:53:32 +0200 Subject: [PATCH] inspect responseType --- LitCalHealth.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/LitCalHealth.php b/LitCalHealth.php index a1f7be89..f42af26a 100644 --- a/LitCalHealth.php +++ b/LitCalHealth.php @@ -231,6 +231,7 @@ private function validateCalendar( string $Calendar, int $Year, string $category libxml_clear_errors(); $message->text = "There was an error decoding the $category of $Calendar for the year $Year from the URL " . self::LitCalBaseUrl . $req . " as XML: " . $errorString; $message->classes = ".calendar-$Calendar.json-valid.year-$Year"; + $message->responsetype = $responseType; $this->sendMessage( $to, $message ); } else { $message = new stdClass(); @@ -257,7 +258,7 @@ private function validateCalendar( string $Calendar, int $Year, string $category $this->sendMessage( $to, $message ); } } - break; + break; case "ICS": try { $vcalendar = VObject\Reader::read( $data ); @@ -296,6 +297,7 @@ private function validateCalendar( string $Calendar, int $Year, string $category $message->type = "error"; $message->text = "There was an error decoding the $category of $Calendar for the year $Year from the URL " . self::LitCalBaseUrl . $req . " as ICS: parsing resulted in type " .gettype( $vcalendar ) . " | " . $vcalendar; $message->classes = ".calendar-$Calendar.json-valid.year-$Year"; + $message->responsetype = $responseType; $this->sendMessage( $to, $message ); } break; @@ -327,6 +329,7 @@ private function validateCalendar( string $Calendar, int $Year, string $category $message->type = "error"; $message->text = "There was an error decoding the $category of $Calendar for the year $Year from the URL " . self::LitCalBaseUrl . $req . " as YAML: " . $ex->getMessage(); $message->classes = ".calendar-$Calendar.json-valid.year-$Year"; + $message->responsetype = $responseType; $this->sendMessage( $to, $message ); } break; @@ -357,6 +360,7 @@ private function validateCalendar( string $Calendar, int $Year, string $category $message->type = "error"; $message->text = "There was an error decoding the $category of $Calendar for the year $Year from the URL " . self::LitCalBaseUrl . $req . " as JSON: " . json_last_error_msg(); $message->classes = ".calendar-$Calendar.json-valid.year-$Year"; + $message->responsetype = $responseType; $this->sendMessage( $to, $message ); } }