ast_assert(response != NULL);
+ if (!value) {
+ ast_ari_response_alloc_failed(response);
+ return;
+ }
+
if (ast_strlen_zero(args->variable)) {
ast_ari_response_error(
response, 400, "Bad Request",
}
} else {
if (!ast_str_retrieve_variable(&value, 0, channel, NULL, args->variable)) {
- ast_ari_response_alloc_failed(response);
+ ast_ari_response_error(
+ response, 404, "Variable Not Found",
+ "Provided variable was not found");
return;
}
}
case 500: /* Internal Server Error */
case 501: /* Not Implemented */
case 400: /* Missing variable parameter. */
- case 404: /* Channel not found */
+ case 404: /* Channel or variable not found */
case 409: /* Channel not in a Stasis application */
is_valid = 1;
break;