cycloidio / raws

[UNMAINTAINED] AWS Reader
MIT License
15 stars 0 forks source link

Refactor error message to be meaningful #11

Closed ifraixedes closed 6 years ago

ifraixedes commented 6 years ago

Refactoring of the error message of the Err type, which is used to return the errors of the AWSReader interface, in order to provide meaningful details of the errors which have happened.

closes #10

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.1%) to 80.374% when pulling 31f21b28b7a275617cc8b3834a2c00f211640418 on if-10 into fe2105660623f38d0b9d22d95648ebb252a0b1e8 on master.

ifraixedes commented 6 years ago

An example of the error output produced with this changes is:

Error: 4 error(s) occurred.
        region: eu-west-3, service: ec2, AWS error message: "eu-west-3: error while using 'ec2' service - DryRunOperation: Request would have succeeded, but DryRun flag is set.
        status code: 412, request id: 64bd9b7d-7836-44b8-9b2d-334b42ee8edd"
        region: eu-west-2, service: ec2, AWS error message: "eu-west-2: error while using 'ec2' service - DryRunOperation: Request would have succeeded, but DryRun flag is set.
        status code: 412, request id: dcdeb4ce-d3b4-4d46-baa8-7a5f02c49308"
        region: eu-west-1, service: ec2, AWS error message: "eu-west-1: error while using 'ec2' service - DryRunOperation: Request would have succeeded, but DryRun flag is set.
        status code: 412, request id: 5a142ab5-b7bc-4c7f-b072-fe71d5d32b36"
        region: eu-central-1, service: ec2, AWS error message: "eu-central-1: error while using 'ec2' service - DryRunOperation: Request would have succeeded, but DryRun flag is set.
        status code: 412, request id: e5969169-a062-4825-ab12-7b97922b8a22"
ifraixedes commented 6 years ago

It can be reviewed again after the #19 and #18 be merged and this branch be rebased with such changes.

xlr-8 commented 6 years ago

The branch need to be rebased as you commented

ifraixedes commented 6 years ago

@xlr-8 Review again, I've realized that they were some tests for the errors and the output wasn't what I expected, so I updated the tests and do the changes again in the errors to pass the test expectations.