Skip to content
This repository has been archived by the owner on May 12, 2020. It is now read-only.

Add possiblity to check an error (exit code) of a postgres process command #107

Open
oilid opened this issue Nov 14, 2017 · 0 comments
Open

Comments

@oilid
Copy link

oilid commented Nov 14, 2017

Currently it's not possible to check an error (exit code) of a postgres process command. The problem ist the code in PostgresProcess.runCmd returns a String returned by "logWatch.getOutput()". But the best option would be to return the value of "proc.waitFor()" which give us the exit code of the process. By convention, 0 indicates normal termination.
Im my concrete case I needed this exit code for the method PostgresProcess.restoreFromFile to know if a database import was successful.
So in my opinion at least the following methods:

  • PostgresProcess.importFromFile
  • PostgresProcess.importFromFileWithArgs
  • PostgresProcess.restoreFromFile
  • PostgresProcess.exportToFile
  • PostgresProcess.exportSchemeToFile
  • PostgresProcess.exportDataToFile

should return the exitCode of the changed method "PostgresProcess.runCmd".

I just realized this issue in my fork (backport java 1.6): oilid/postgresql-embedded@22e649d

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant