/**
* Render an exception as HTML string.
*
- * @param Exception $e
+ * @param Throwable $e
* @return string
* printable HTML text
*/
- public static function formatHtmlException(Exception $e) {
+ public static function formatHtmlException(Throwable $e) {
$msg = '';
// Exception metadata
/**
* Write details of an exception to the log.
*
- * @param Exception $e
+ * @param Throwable $e
* @return string
* printable plain text
*/
- public static function formatTextException(Exception $e) {
+ public static function formatTextException(Throwable $e) {
$msg = get_class($e) . ": \"" . $e->getMessage() . "\"\n";
$ei = $e;
$callerClass = $dbt[1]['class'] ?? NULL;
$oldMethod = "{$callerClass}::{$callerFunction}";
}
- Civi::log()->warning("Deprecated function $oldMethod, use $newMethod.", ['civi.tag' => 'deprecated']);
+ self::deprecatedWarning("Deprecated function $oldMethod, use $newMethod.");
+ }
+
+ /**
+ * Output a deprecated notice about a deprecated call path, rather than deprecating a whole function.
+ * @param string $message
+ */
+ public static function deprecatedWarning($message) {
+ Civi::log()->warning($message, ['civi.tag' => 'deprecated']);
}
}