Skip to content
Unverified Commit dfa0b3be authored by Paul Wise's avatar Paul Wise
Browse files

Improve the handling of the database

Try to reopen the connection when resetting it fails.

Give error messages instead of tracebacks on errors.

Factor out common code into functions.

Hopefully fixes this Traceback (most recent call last):
  File ".../bin/compare-source-package-list", line 1163, in <module>
    files, patches, links, new = process_sources(source_entries, lists_dir)
  File ".../bin/compare-source-package-list", line 1141, in process_sources
    actions = check_source_package(source_entry, srcpkg)
  File ".../bin/compare-source-package-list", line 1090, in check_source_package
    derived_from = find_derived_from(tmp_dir, name, version, dsc_name, dsc_sha1, parts_unmodified)
  File ".../bin/compare-source-package-list", line 830, in find_derived_from
    part_derived_from = sha1_to_srcpkgs(part_sha1)
  File ".../bin/compare-source-package-list", line 549, in sha1_to_srcpkgs
    database_error(e)
  File ".../bin/compare-source-package-list", line 526, in database_error
    conn.reset()
psycopg2.InterfaceError: connection already closed
parent a82d1574
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment