Added updated error handling code

Added a new helper function to enable better error processing of the
Holdings processing functions