Added DB error handling
Added DB error handling

This commit addresses issues related to DB errors when inserting records.
Also, the DB insertion process has been sequenced to occur before the
actual file transfer. This allows us to abort any transfer operation in
case the corresponding DB operation failed. In case of DB operation
failure, the script prints the appropriate message and exits.

ColoredInsaneAsylums/DarkArchiveWorkflow