Perhaps we should be using this function: https://github.com/Islandora/islandora/blob/7.x/islandora.module#L1260 for its error handling,