openbel-api 1.0.2-java → 1.0.3-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b87c630e974a44f066e87080bc5eaa36fbad8b9
4
- data.tar.gz: 7b3868b183369a508d18a3a7fc230f1c3f881d52
3
+ metadata.gz: 25d2e441f67f4be259e2f3a594a66c1c6524c061
4
+ data.tar.gz: 2dde1eb0808d0f1ded754a447ca787c06e8196e7
5
5
  SHA512:
6
- metadata.gz: e170f818a3c1e31e07af75cdfd05ecbeda514fe21e314335369e9f8ff88ab62452c5cd10e11b49bcfc1a80f6633b0040f662eebc0e82d4648dc5a8d03c9c0f97
7
- data.tar.gz: 2dfcc8de40f092e7b31e23c4064e311ec6a9e934d43f401d2f30e4b3829aa833a78b3f8f51963fdf7865ebcaf7be226cd2091dd54b0ec88725cadf3ec2514af5
6
+ metadata.gz: f1564a9fa715f528b2dce42f4f6238fb78f15bced541a786eee8b7c595b325ce2d19a596fc07bab9e579976c560137ccb22bed17af2d1a00420462896e5d1f5f
7
+ data.tar.gz: 84721bf531574e8c9355a26246c7f039c8556f28a0f1914ae251609dbd7ded8792a4c7dd05f22cd825141abfbe4915cf72b1592f2b3c55c796746ca65fe99a4f
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.2
1
+ 1.0.3
@@ -72,16 +72,26 @@ module OpenBEL
72
72
  def check_dataset(io, type)
73
73
  begin
74
74
 
75
- # See https://github.com/OpenBEL/openbel-api/issues/120
76
- BEL.nanopub(io, type, :language => @bel_version).each do |nanopub|
77
- BEL.object_convert(String, nanopub.to_h) { |str|
78
- unless str.valid_encoding?
79
- msg = 'Invalid encoding. UTF-8 is required.'
80
- response = render_json({:status => 415, :msg => msg})
81
- halt(415, { 'Content-Type' => 'application/json' }, response)
82
- end
83
- }
75
+ begin
76
+ # See https://github.com/OpenBEL/openbel-api/issues/120
77
+ BEL.nanopub(io, type, :language => @bel_version).each do |nanopub|
78
+ BEL.object_convert(String, nanopub.to_h) { |str|
79
+ unless str.valid_encoding?
80
+ msg = 'Invalid encoding. UTF-8 is required.'
81
+ response = render_json({:status => 415, :msg => msg})
82
+ halt(415, { 'Content-Type' => 'application/json' }, response)
83
+ end
84
+ }
85
+ end
86
+ rescue Exception => e
87
+ puts e.message
88
+ puts e.backtrace.inspect
89
+ msg = 'Failed to parse the posted BEL nanopub.'
90
+ response = render_json({:status => 400, :msg => msg})
91
+ halt(400, { 'Content-Type' => 'application/json' }, response)
84
92
  end
93
+
94
+
85
95
  io.rewind
86
96
 
87
97
  nanopub = BEL.nanopub(io, type).each.first
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openbel-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: java
6
6
  authors:
7
7
  - Anthony Bargnesi