rbbt-rest 1.3.16 → 1.3.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rbbt/rest/common/render.rb +15 -2
- data/lib/rbbt/rest/workflow/jobs.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b087f8339e7a65c9e44b765d5b78d656fe9e613d
|
4
|
+
data.tar.gz: e1eef5d17962223f05ea3e5b65aea531e1cf389c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ba5c13c66439f9e9ea52535790b449cd050cf93a45b962be5266551e97928ccdcf7bb9065e5f8ccf2a5d3cf39b3d99fe6ef8cfa0a8079cdf4eaa7a57aef7422
|
7
|
+
data.tar.gz: 5cb298f5e8d58ef8f391a48f58e98b031200d445ca218b7f6fbe8743985e03e354ffe0362f3eaa90a4ce84d8b21404f3e413da0e4db1332bc8c5fd43e8113a44
|
@@ -4,9 +4,20 @@ require 'tilt'
|
|
4
4
|
|
5
5
|
module RbbtRESTHelpers
|
6
6
|
def error_for(job, layout = nil)
|
7
|
-
if
|
8
|
-
|
7
|
+
if ex = job.info[:exception]
|
8
|
+
klass = ex[:class]
|
9
|
+
msg = ex[:message]
|
10
|
+
bkt = ex[:backtrace]
|
9
11
|
else
|
12
|
+
klass = "Exception"
|
13
|
+
msg = job.messages[-1]
|
14
|
+
bkt = []
|
15
|
+
end
|
16
|
+
|
17
|
+
case @format
|
18
|
+
when :json
|
19
|
+
halt 400, {"message" => msg, "backtrace" => bkt}.to_json
|
20
|
+
when :html
|
10
21
|
layout = @layout if layout.nil?
|
11
22
|
layout_file = (layout ? locate_template('layout') : nil)
|
12
23
|
template_file = locate_template('error')
|
@@ -14,6 +25,8 @@ module RbbtRESTHelpers
|
|
14
25
|
result = render template_file, {:job => job}, layout_file
|
15
26
|
|
16
27
|
halt 400, result
|
28
|
+
else
|
29
|
+
halt 400, "#{klass}: " << msg << "\nBacktrace: " << btk * "\n"
|
17
30
|
end
|
18
31
|
end
|
19
32
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbbt-rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|