Skip to content

Commit

Permalink
inspect responseType
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRDOrazio committed May 22, 2024
1 parent bd60db3 commit 6d206a9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion LitCalHealth.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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 );
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 );
}
}
Expand Down

0 comments on commit 6d206a9

Please sign in to comment.