Yes.  You cannot delete the branch that HEAD has checked out right now.  The caller should instead detached HEAD, or checkout a different branch first.  This is probably a new top-level exception type for us, I can't think of an existing error type that makes sense to use.