I think the code is working as intended if err != nil. It sets the `e` field on sessionInfo with the error and stores it in the registry.

The case we would need to handle is if `session == nil`, because then then `session.name = name` below would fail. If we want to be defensive then probably the best thing to do is make a new empty session object.