Skip to content
Snippets Groups Projects
Commit d5679493 authored by Pavel Kácha's avatar Pavel Kácha
Browse files

Turned sendEvents multiple errors into real Error, so client does not have to special case

parent c55d4df1
No related branches found
No related tags found
No related merge requests found
......@@ -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"],
......
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment