Raise custom errors when a shell command fails