This is a library module - use exceptions for raising errors. See the other resource functions for examples.