[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[reclaim-oidc] 16/18: added error handling for unknown commands + REST s
From: |
gnunet |
Subject: |
[reclaim-oidc] 16/18: added error handling for unknown commands + REST service not running |
Date: |
Sat, 12 Jun 2021 00:40:52 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository reclaim-oidc.
commit 0e475c526c942c77ef34acd535ff7cbf173cadca
Author: Alexia Pagkopoulou <a.pagkopoulou@tum.de>
AuthorDate: Wed Aug 21 15:28:56 2019 +0200
added error handling for unknown commands + REST service not running
---
bin/reclaim-oidc | 10 +++++++---
lib/reclaim_oidc.rb | 9 +++++++--
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/bin/reclaim-oidc b/bin/reclaim-oidc
index 749c7e9..878f43f 100755
--- a/bin/reclaim-oidc
+++ b/bin/reclaim-oidc
@@ -89,13 +89,13 @@ class OptParser
self.verbose = v
end
end
-
+
def jwt_secret_option(parser)
parser.on("-j", "--jwt-secret [JWT-SECRET]", "Set JWT secret") do |v|
self.jwt_secret = v
end
end
- end
+ end
#
# Return a structure describing the options.
@@ -107,7 +107,11 @@ class OptParser
@options = ScriptOptions.new
@args = OptionParser.new do |parser|
@options.define_options(parser)
- parser.parse!(args)
+ begin
+ parser.parse!(args)
+ rescue OptionParser::InvalidOption => e
+ puts "ERROR: Invalid option"
+ end
end
@options
end
diff --git a/lib/reclaim_oidc.rb b/lib/reclaim_oidc.rb
index fa91c05..4c06936 100644
--- a/lib/reclaim_oidc.rb
+++ b/lib/reclaim_oidc.rb
@@ -26,8 +26,13 @@ class ReclaimOidc
def get_client_secret
uri = URI(@url + '/config/reclaim-rest-plugin')
- resp = JSON.parse Net::HTTP.get(uri)
- return resp["OIDC_CLIENT_SECRET"]
+ begin
+ resp = JSON.parse Net::HTTP.get(uri)
+ return resp["OIDC_CLIENT_SECRET"]
+ rescue Errno::ECONNREFUSED => e
+ puts "ERROR: REST service is not running"
+ exit
+ end
end
def get_clients
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [reclaim-oidc] 17/18: Merge branch 'master' into 'master', (continued)
- [reclaim-oidc] 17/18: Merge branch 'master' into 'master', gnunet, 2021/06/11
- [reclaim-oidc] 08/18: old style posts, gnunet, 2021/06/11
- [reclaim-oidc] 07/18: 0.0.2, gnunet, 2021/06/11
- [reclaim-oidc] 15/18: Merge branch 'master' into 'master', gnunet, 2021/06/11
- [reclaim-oidc] 11/18: 0.0.5, gnunet, 2021/06/11
- [reclaim-oidc] 12/18: update readme, gnunet, 2021/06/11
- [reclaim-oidc] 13/18: add image, gnunet, 2021/06/11
- [reclaim-oidc] 02/18: add license and readme, gnunet, 2021/06/11
- [reclaim-oidc] 18/18: update to v0.0.7, gnunet, 2021/06/11
- [reclaim-oidc] 10/18: reduce expiration times for client info, gnunet, 2021/06/11
- [reclaim-oidc] 16/18: added error handling for unknown commands + REST service not running,
gnunet <=
- [reclaim-oidc] 14/18: added command for changing the jwt secret, gnunet, 2021/06/11