Last active
September 2, 2016 14:20
-
-
Save expede/bde610d98f26e0b689b7687f91556118 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
search_result = find_book(title: title) | |
case search_result do | |
page = %Page{} -> render(page) | |
%Ecto.MultipleResultsError{} when is_series(title) -> | |
%Book.SeriesAreNotBooksError{ | |
message: "#{title} is a series, not a book.", | |
title: title, | |
series: search_result, | |
plug_status: 422 | |
} | |
other_exception -> other_exception | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment