bdcs-0.2.0: Tools for managing a content store of software packages

Copyright(c) 2016-2017 Red Hat Inc.
LicenseLGPL
Maintainerhttps://github.com/weldr
Stabilityalpha
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

BDCS.Exceptions

Description

Utilities for working with database-related exceptions.

Synopsis

Documentation

data DBException Source #

A general purpose exception type for dealing with things that go wrong when working with the database. This type could grow into a more complex system in the future, if needed. This type is most helpful because runSqlite will roll back the entire transaction if an exception is raised.

Constructors

DBException String

A general purpose exception type, including an error message.

MissingRPMTag String

A required tag was missing from the RPM being processed. The argument should be the name of the missing tag.

BadName String

The name of the package is not parseable.

throwIfNothing :: Exception e => Maybe a -> e -> a Source #

If a Maybe value is Nothing, throw the given exception. Otherwise, return the value inside.

throwIfNothingOtherwise :: Exception e => Maybe a -> e -> (a -> b) -> b Source #

If a Maybe value is Nothing, throw the given exception. Otherwise, run the provided function on the value inside and return the result.