private static function appendExceptions($response, \Exception $e, $subtype = true) { if ($subtype === true) { if ($e instanceof MetadataProviderException) { $response .= "M"; } elseif ($e instanceof NotificationException) { $response .= "N"; } elseif ($e instanceof AccessException) { $response .= "A"; } elseif ($e instanceof ItemsException) { $response .= "I"; } elseif ($e instanceof SchemaException) { $response .= "S"; } elseif ($e instanceof CreditsException) { if ($e instanceof ConflictingSessionException) { $response .= "X"; } else { $response .= "C"; } } } $response .= "|" . self::encodeString($e->getMessage()); if ($subtype === true) { if ($e instanceof CreditsException) { $response .= "|" . $e->getCode() . "|" . self::encodeString($e->getClientUserMsg()); if ($e instanceof ConflictingSessionException) { $response .= "|" . self::encodeString($e->getConflictingSessionID()); } } } return $response; }
private static function appendExceptions($response, \Exception $e, $subtype = true) { if ($subtype === true) { if ($e instanceof DataProviderException) { $response .= "D"; } elseif ($e instanceof SubscriptionException) { $response .= "U"; } elseif ($e instanceof FailureException) { $response .= "F"; } } $response .= "|" . self::encodeString($e->getMessage()); if ($subtype === true) { if ($e instanceof CreditsException) { $response .= "|" . $e->getCode() . "|" . self::encodeString($e->getClientUserMsg()); if ($e instanceof ConflictingSessionException) { $response .= "|" . self::encodeString($e->getConflictingSessionID()); } } } return $response; }