wd_sinatra 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +10 -0
- data/lib/wd_sinatra/version.rb +1 -1
- data/templates/lib/hooks.rb +2 -2
- metadata +1 -1
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# Weasel Diesel Sinatra Changelog
|
2
2
|
|
3
|
+
## 0.2.3
|
4
|
+
|
5
|
+
* Fixed the example of the `params_exception_handler` hook added in the
|
6
|
+
generated `hooks.rb` file.
|
7
|
+
|
8
|
+
## 0.2.2
|
9
|
+
|
10
|
+
* Added a `params_exception_handler` hook to customize the rescue of an
|
11
|
+
exception being raised in the params processing phase.
|
12
|
+
|
3
13
|
## 0.2.1
|
4
14
|
|
5
15
|
* fixed the content type on the param verification error message
|
data/lib/wd_sinatra/version.rb
CHANGED
data/templates/lib/hooks.rb
CHANGED
@@ -36,9 +36,9 @@ module WDSinatraHooks
|
|
36
36
|
# exception message sent back as a json.
|
37
37
|
#
|
38
38
|
# @param [Exception] exception The exception that was rescued.
|
39
|
-
# def
|
39
|
+
# def params_exception_handler(exception)
|
40
40
|
# # example implementation:
|
41
|
-
# # halt 400, {'Content-Type' => 'application/json'}, {:error =>
|
41
|
+
# # halt 400, {'Content-Type' => 'application/json'}, {:error => exception.message}.to_json
|
42
42
|
# end
|
43
43
|
|
44
44
|
# This hook gets called after the params are being verified.
|