Commit ba046d2f authored by Bruno Nocera Zanette's avatar Bruno Nocera Zanette

fix StandardError response

parent 7eb337da
......@@ -5,7 +5,7 @@ module Dspace
resources do
default_handler(400) { raise InvalidTokenError, 'Invalid access token.' }
default_handler(403) { raise InvalidCredentialsError, 'Wrong Dspace credentials.' }
default_handler { |response| raise StandardError, "#{response}" }
default_handler { |response| raise StandardError, "#{response.inspect}" }
action :login, 'POST /rest/login' do
body { |email, password| JSON.generate({email: email, password: password}) }
......
......@@ -4,7 +4,7 @@ module Dspace
resources do
default_handler(401) { raise NotAuthorizedError, 'This request requires authentication' }
default_handler { |response| raise StandardError, "#{response}" }
default_handler { |response| raise StandardError, "#{response.inspect}" }
action :all, 'GET /rest/bitstreams' do
query_keys :expand, :limit, :offset
......
......@@ -4,7 +4,7 @@ module Dspace
resources do
default_handler(401) { raise NotAuthorizedError, 'This request requires authentication' }
default_handler { |response| raise StandardError, "#{response}" }
default_handler { |response| raise StandardError, "#{response.inspect}" }
action :all, 'GET /rest/collections' do
query_keys :expand, :limit, :offset
......
......@@ -4,7 +4,7 @@ module Dspace
resources do
default_handler(401) { raise NotAuthorizedError, 'This request requires authentication' }
default_handler { |response| raise StandardError, "#{response}" }
default_handler { |response| raise StandardError, "#{response.inspect}" }
action :all, 'GET /rest/communities' do
query_keys :expand, :limit, :offset
......
......@@ -4,7 +4,7 @@ module Dspace
resources do
default_handler(401) { raise NotAuthorizedError, 'This request requires authentication' }
default_handler { |response| raise StandardError, "#{response}" }
default_handler { |response| raise StandardError, "#{response.inspect}" }
action :all, 'GET /rest/items' do
query_keys :expand, :limit, :offset
......
......@@ -3,7 +3,7 @@ module Dspace
class StatusResource < ResourceKit::Resource
resources do
default_handler { |response| raise StandardError, "#{response}" }
default_handler { |response| raise StandardError, "#{response.inspect}" }
action :test, 'GET /rest/test' do
handler(200, 201) { |response| true }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment