fix error handling of register request with unknown transport
This commit is contained in:
parent
066d89873a
commit
41b3d84e9d
1 changed files with 18 additions and 19 deletions
|
@ -123,10 +123,7 @@ class SubscriptionManagementPlugin extends ServerPlugin {
|
|||
|
||||
$transport = $this->transportManager->getTransport($subscriptionType);
|
||||
|
||||
if($transport === null) {
|
||||
$errors[] = $subscriptionType . " transport does not exist";
|
||||
}
|
||||
|
||||
if(!is_null($transport)) {
|
||||
[
|
||||
'success' => $registerSuccess,
|
||||
'error' => $registerError,
|
||||
|
@ -139,10 +136,12 @@ class SubscriptionManagementPlugin extends ServerPlugin {
|
|||
$responseStatus = $responseStatus ?? Http::STATUS_CREATED;
|
||||
$data = $data ?? False;
|
||||
|
||||
|
||||
if(!$registerSuccess) {
|
||||
$errors[] = $registerError;
|
||||
}
|
||||
} else {
|
||||
$errors[] = $subscriptionType . " transport does not exist";
|
||||
}
|
||||
|
||||
if(sizeof($errors) == 0) {
|
||||
$response->setStatus($responseStatus);
|
||||
|
|
Loading…
Reference in a new issue