Im using http_basic method in Grape in my rails app, I have got it working but would like to provide a custom error if the authentication details are incorrect.
http_basic do |username, password|
@project = Project.where(api_key: username).first
end
This works but I cant seem to be able to throw a custom error if the project cannot be found