Skip to content

add error details when throwing HydratingException - #12

Open
nguyenk wants to merge 2 commits into
thecodingmachine:1.xfrom
nguyenk:addErrorDetails
Open

add error details when throwing HydratingException#12
nguyenk wants to merge 2 commits into
thecodingmachine:1.xfrom
nguyenk:addErrorDetails

Conversation

@nguyenk

@nguyenk nguyenk commented Nov 2, 2018

Copy link
Copy Markdown
Member

Fixes #11

@coveralls

coveralls commented Nov 2, 2018

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.8%) to 84.0% when pulling 8ef3c8c on nguyenk:addErrorDetails into abd3a25 on thecodingmachine:1.x.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.1%) to 83.136% when pulling 414b02c on nguyenk:addErrorDetails into abd3a25 on thecodingmachine:1.x.

@moufmouf

moufmouf commented Nov 6, 2018

Copy link
Copy Markdown
Member

This PR seems to break the unit tests. Could you fix this?

@nguyenk

nguyenk commented Nov 9, 2018

Copy link
Copy Markdown
Member Author

Yes, done. I had to build errors message recursively.

@moufmouf moufmouf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we try this code with a small unit test? This seems untested to me.

public function __construct($errorsMap, $message = "", $code = 412)
{
$errorMessages = $this->getErrorMessage($errorsMap);
$message .= "Detailed errors : \n " . implode(", ", $errorMessages);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$message .= "Detailed errors : \n " . implode(", ", $errorMessages);
$message .= " - Detailed errors : \n " . implode(", ", $errorMessages);

Maybe we could add a "dash" before the "Detailed errors" message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants