Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make multimethods public, check for explicit problem type #97

Merged
merged 2 commits into from
May 29, 2018
Merged

Conversation

bhb
Copy link
Owner

@bhb bhb commented May 26, 2018

This opens to door to allowing external libraries to control how expound prints problems from other types of specs.

I'd like to refine the extensibility for expound for the eventual beta version, but hopefully this will work in a pinch.

@bhb bhb changed the base branch from master to next May 26, 2018 01:06
@bhb bhb changed the base branch from next to master May 26, 2018 01:07
@bhb bhb changed the base branch from master to next May 26, 2018 01:07
@bhauman
Copy link
Contributor

bhauman commented May 28, 2018

I'm sorry to hit you up for a release, but I'm going to try and release my spell-spec library https://github.com/bhauman/spell-spec so I can start using it in figwheel-main for config validation.

@@ -381,6 +381,9 @@

(defn ^:private problem-type [failure problem]
(cond
(:expound.spec.problem/type problem)
Copy link
Contributor

@bhauman bhauman May 28, 2018

Choose a reason for hiding this comment

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

The above should probably be

(when-let [typ (:expound.spec.problem/type problem)]
   (get-method expound/problem-group-str typ))

to ensure that the problem type is supported.

If not fallback to expounds normal behavior.

Copy link
Contributor

Choose a reason for hiding this comment

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

otherwise an error will be thrown for an unsupported type

Copy link
Owner Author

Choose a reason for hiding this comment

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

Good call.

@bhb
Copy link
Owner Author

bhb commented May 28, 2018

@bhauman Thanks for the help here. I'm hoping to get some time to do a release tonight, or failing that, tomorrow.

@bhb bhb merged commit bfbfc47 into next May 29, 2018
@bhb bhb deleted the problem-type branch October 6, 2018 17:14
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.

2 participants