Ticket #13 (new task)

Opened 2 years ago

Last modified 6 months ago

data source layer should have useful exceptions

Reported by: marienz Owned by:
Priority: major Milestone:
Component: pkgcore Version:
Keywords: Cc:

Description

Currently an attempt to open a local_source with a bogus path lets the IOError reach calling code. There should be some data_source specific exceptions here so calling code can deal with various kinds of sources sensibly (checking for ENOENT probably does not make sense for networked data sources). Todo:

  • come up with a good set of exceptions
  • make the existing sources raise them and not let IOError/OSError through
  • remove the ugly hack I just added to repo_objs.py

Change History

comment:1 Changed 2 years ago by ferringb

imo, local_source consumers should *know* the source is available; in the specific case of metadata.xml parsing, I was being lazy and attempting to avoid a stat'ing instead of honoring that implicit req of local_source.

Meanwhile, backed out the ugly hack and slipped in LocalMetadataXml? that handles nonexisting metadata.xml at the time of forced parsing.

comment:2 Changed 2 years ago by marienz

  • component set to pkgcore

comment:3 Changed 21 months ago by ferringb

@marienz: thoughts/comments on this? Honestly haven't really poked at it much in light of comment #2 :)

comment:4 Changed 6 months ago by masterdriverz

  • type changed from defect to task
Note: See TracTickets for help on using tickets.