Fix a couple of error responses
Errors should always be "error:{"msg":"message"}
			
			
This commit is contained in:
		
							parent
							
								
									c58e1994e9
								
							
						
					
					
						commit
						2481c486a5
					
				| @ -1473,7 +1473,7 @@ def v0_api(api): | |||||||
|         try: |         try: | ||||||
|             uuid_cancel(api.config["COMPOSER_CFG"], uuid) |             uuid_cancel(api.config["COMPOSER_CFG"], uuid) | ||||||
|         except Exception as e: |         except Exception as e: | ||||||
|             return jsonify(status=False, uuid=uuid, msg=str(e)) |             return jsonify(status=False, uuid=uuid, error={"msg":str(e)}),400 | ||||||
|         else: |         else: | ||||||
|             return jsonify(status=True, uuid=uuid) |             return jsonify(status=True, uuid=uuid) | ||||||
| 
 | 
 | ||||||
| @ -1505,7 +1505,7 @@ def v0_api(api): | |||||||
|         try: |         try: | ||||||
|             info = uuid_info(api.config["COMPOSER_CFG"], uuid) |             info = uuid_info(api.config["COMPOSER_CFG"], uuid) | ||||||
|         except Exception as e: |         except Exception as e: | ||||||
|             return jsonify(status=False, msg=str(e)) |             return jsonify(status=False, error={"msg":str(e)}), 400 | ||||||
| 
 | 
 | ||||||
|         return jsonify(**info) |         return jsonify(**info) | ||||||
| 
 | 
 | ||||||
| @ -1588,8 +1588,8 @@ def v0_api(api): | |||||||
|         if status is None: |         if status is None: | ||||||
|             return jsonify(status=False, error={"msg":"%s is not a valid build uuid" % uuid}), 400 |             return jsonify(status=False, error={"msg":"%s is not a valid build uuid" % uuid}), 400 | ||||||
|         elif status["queue_status"] == "WAITING": |         elif status["queue_status"] == "WAITING": | ||||||
|             return jsonify(status=False, uuid=uuid, msg="Build has not started yet. No logs to view") |             return jsonify(status=False, uuid=uuid, error={"msg":"Build has not started yet. No logs to view"}) | ||||||
|         try: |         try: | ||||||
|             return Response(uuid_log(api.config["COMPOSER_CFG"], uuid, size), direct_passthrough=True) |             return Response(uuid_log(api.config["COMPOSER_CFG"], uuid, size), direct_passthrough=True) | ||||||
|         except RuntimeError as e: |         except RuntimeError as e: | ||||||
|             return jsonify(status=False, uuid=uuid, msg=str(e)) |             return jsonify(status=False, uuid=uuid, error={"msg":str(e)}), 400 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user