diff --git a/warden3/warden_client/warden_client_test.py b/warden3/warden_client/warden_client_test.py index 3eb85c43af1a3775193c2bd4e3872980a04fba38..74f39f0a6c18419f5551b1d91d20a162c00d6dd2 100755 --- a/warden3/warden_client/warden_client_test.py +++ b/warden3/warden_client/warden_client_test.py @@ -82,6 +82,7 @@ def gen_random_idea(client_name="cz.example.warden.test"): "Confidence": random(), "Note": "Random event", "ConnCount": randint(0, 65535), +# "ConnCount": choice([randint(0, 65535), "asdf"]), # Send wrong event sometimes "Source": [ { "Type": ["Phishing"], diff --git a/warden3/warden_server/warden_server.py b/warden3/warden_server/warden_server.py index 07e7df14936815dfd7c8f88ad6af0beabceb58e2..ca7e4f4322323a0fe496f6838a09c1fdd3f3cca9 100755 --- a/warden3/warden_server/warden_server.py +++ b/warden3/warden_server/warden_server.py @@ -854,10 +854,10 @@ class WardenHandler(ObjectReq): logging.info("Saved %i events" % saved) if errs: - logging.info("Errors: \n%s\n" % str(errs)) - - return errs + raise self.req.error("Errors saving some messages.", 422, + detail={"errors": errs}) + return saved def read_ini(path):