test that `die` exits with custom error code and message