gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] branch master updated: fix #7513


From: gnunet
Subject: [libeufin] branch master updated: fix #7513
Date: Fri, 13 Jan 2023 16:47:16 +0100

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new 094c55e4 fix #7513
094c55e4 is described below

commit 094c55e456480aa4be87568cfe36de50583bdf05
Author: MS <ms@taler.net>
AuthorDate: Fri Jan 13 16:46:45 2023 +0100

    fix #7513
---
 nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt  |  8 +++----
 .../src/main/kotlin/tech/libeufin/sandbox/Main.kt  | 28 +++++++++-------------
 2 files changed, 14 insertions(+), 22 deletions(-)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
index e27d7df1..df1fe2d8 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
@@ -43,9 +43,7 @@ val logger: Logger = 
LoggerFactory.getLogger("tech.libeufin.nexus")
 const val NEXUS_DB_ENV_VAR_NAME = "LIBEUFIN_NEXUS_DB_CONNECTION"
 
 class NexusCommand : CliktCommand() {
-    init {
-        versionOption(getVersion())
-    }
+    init { versionOption(getVersion()) }
     override fun run() = Unit
 }
 
@@ -79,7 +77,7 @@ class Serve : CliktCommand("Run nexus HTTP server") {
         startOperationScheduler(client)
         if (withUnixSocket != null) {
             startServer(
-                withUnixSocket ?: throw Exception("Could not use the Unix 
domain socket path value!"),
+                withUnixSocket!!,
                 app = nexusApp
             )
             exitProcess(0)
@@ -132,7 +130,7 @@ class Superuser : CliktCommand("Add superuser or change 
pw") {
                 }
             } else {
                 if (!user.superuser) {
-                    println("Can only change password for superuser with this 
command.")
+                    System.err.println("Can only change password for superuser 
with this command.")
                     throw ProgramResult(1)
                 }
                 user.passwordHash = hashedPw
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt 
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
index d4b72bae..115f2e4a 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -102,7 +102,7 @@ class DefaultExchange : CliktCommand("Set default Taler 
exchange for a demobank.
                     DemobankConfigsTable.name eq demobank
                 }.firstOrNull()
                 if (maybeDemobank == null) {
-                    println("Error, demobank ${demobank} not found.")
+                    System.err.println("Error, demobank $demobank not found.")
                     exitProcess(1)
                 }
                 maybeDemobank.suggestedExchangeBaseUrl = exchangeBaseUrl
@@ -112,9 +112,7 @@ class DefaultExchange : CliktCommand("Set default Taler 
exchange for a demobank.
     }
 }
 
-class Config : CliktCommand(
-    "Insert one configuration (a.k.a. demobank) into the database."
-) {
+class Config : CliktCommand("Insert one configuration (a.k.a. demobank) into 
the database.") {
     init {
         context {
             helpFormatter = CliktHelpFormatter(showDefaultValues = true)
@@ -147,7 +145,7 @@ class Config : CliktCommand(
     override fun run() {
         val dbConnString = getDbConnFromEnv(SANDBOX_DB_ENV_VAR_NAME)
         if (nameArgument != "default") {
-            println("This version admits only the 'default' name")
+            System.err.println("This version admits only the 'default' name")
             exitProcess(1)
         }
         execThrowableOrTerminate {
@@ -244,8 +242,8 @@ class Camt053Tick : CliktCommand(
                     newStatements[accountIter.label]?.add(
                         getHistoryElementFromTransactionRow(it)
                     ) ?: run {
-                        logger.warn("Array operation failed while building 
statements for account: ${accountIter.label}")
-                        println("Fatal array error while building the 
statement, please report.")
+                        logger.error("Array operation failed while building 
statements for account: ${accountIter.label}")
+                        System.err.println("Fatal array error while building 
the statement, please report.")
                         exitProcess(1)
                     }
                 }
@@ -301,7 +299,7 @@ class MakeTransaction : CliktCommand("Wire-transfer money 
between Sandbox bank a
             System.err.println(e.message)
             exitProcess(1)
         } catch (e: Exception) {
-            System.err.println(e)
+            System.err.println(e.message)
             exitProcess(1)
         }
     }
@@ -313,7 +311,6 @@ class ResetTables : CliktCommand("Drop all the tables from 
the database") {
             helpFormatter = CliktHelpFormatter(showDefaultValues = true)
         }
     }
-
     override fun run() {
         val dbConnString = getDbConnFromEnv(SANDBOX_DB_ENV_VAR_NAME)
         execThrowableOrTerminate {
@@ -351,7 +348,7 @@ class Serve : CliktCommand("Run sandbox HTTP server") {
         WITH_AUTH = auth
         setLogLevel(logLevel)
         if (WITH_AUTH && adminPassword == null) {
-            println("Error: auth is enabled, but env 
LIBEUFIN_SANDBOX_ADMIN_PASSWORD is not."
+            System.err.println("Error: auth is enabled, but env 
LIBEUFIN_SANDBOX_ADMIN_PASSWORD is not."
             + " (Option --no-auth exists for tests)")
             exitProcess(1)
         }
@@ -359,13 +356,13 @@ class Serve : CliktCommand("Run sandbox HTTP server") {
         // Refuse to operate without a 'default' demobank.
         val demobank = getDemobank("default")
         if (demobank == null) {
-            println("Sandbox cannot operate without a 'default' demobank.")
-            println("Please make one with the 'libeufin-sandbox config' 
command.")
+            System.err.println("Sandbox cannot operate without a 'default' 
demobank.")
+            System.err.println("Please make one with the 'libeufin-sandbox 
config' command.")
             exitProcess(1)
         }
         if (withUnixSocket != null) {
             startServer(
-                withUnixSocket ?: throw Exception("Could not use the Unix 
domain socket path value!"),
+                withUnixSocket!!,
                 app = sandboxApp
             )
             exitProcess(0)
@@ -429,10 +426,7 @@ fun ensureNonNull(param: String?): String {
 }
 
 class SandboxCommand : CliktCommand(invokeWithoutSubcommand = true, 
printHelpOnEmptyArgs = true) {
-    init {
-        versionOption(getVersion())
-    }
-
+    init { versionOption(getVersion()) }
     override fun run() = Unit
 }
 

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]