better exception handling

@sneal squirrel?