commanded-audit-middleware icon indicating copy to clipboard operation
commanded-audit-middleware copied to clipboard

Error thrown before the start_time causes delta for end_time to fail

Open scott-wyatt opened this issue 5 years ago • 1 comments

Error

1) test register user should fail when email address already taken and return error (Conduit.UsersTest)
     test/conduit/users/users_test.exs:69
     ** (FunctionClauseError) no function clause matching in Commanded.Middleware.Auditing.delta/1

     The following arguments were given to Commanded.Middleware.Auditing.delta/1:

%Commanded.Middleware.Pipeline{assigns: %{error: :validation_failure, error_reason: %{email: ["has already been taken"]}}, 
...

To Reproduce

Add commanded-audit-middleware to Conduit, and then run mix test.

Suggested Solution

Pattern Matching for delta

for when a delta does not yet have a start_time and error is already thrown.

scott-wyatt avatar Dec 01 '18 21:12 scott-wyatt