Browse code

mqueue: Use HTTP status codes for rpc

Alex Hermann authored on 19/04/2018 21:03:32
Showing 1 changed files
... ...
@@ -294,13 +294,13 @@ static void  mqueue_rpc_get_size(rpc_t* rpc, void* ctx)
294 294
 	int			mqueue_sz = 0;
295 295
 
296 296
 	if (rpc->scan(ctx, "S", &mqueue_name) < 1) {
297
-		rpc->fault(ctx, 500, "No queue name");
297
+		rpc->fault(ctx, 400, "No queue name");
298 298
 		return;
299 299
 	}
300 300
 
301 301
 	if(mqueue_name.len <= 0 || mqueue_name.s == NULL) {
302 302
 		LM_ERR("bad mqueue name\n");
303
-		rpc->fault(ctx, 500, "Invalid queue name");
303
+		rpc->fault(ctx, 400, "Invalid queue name");
304 304
 		return;
305 305
 	}
306 306
 
... ...
@@ -308,7 +308,7 @@ static void  mqueue_rpc_get_size(rpc_t* rpc, void* ctx)
308 308
 
309 309
 	if(mqueue_sz < 0) {
310 310
 		LM_ERR("no such mqueue\n");
311
-		rpc->fault(ctx, 500, "No such queue");
311
+		rpc->fault(ctx, 404, "No such queue");
312 312
 		return;
313 313
 	}
314 314