Unless there's a compelling reason to throw when a developer calls client.release more than once, I'd prefer to see client.release mutate itself into a noop the first time it's called - that would be better for developer ergonomics.
Related question: Is there an easy way to determine whether a client has already been released (easier than wrapping client.release() in a try...catch block and ignoring the exception)?
Unless there's a compelling reason to throw when a developer calls
client.releasemore than once, I'd prefer to seeclient.releasemutate itself into anoopthe first time it's called - that would be better for developer ergonomics.Related question: Is there an easy way to determine whether a client has already been released (easier than wrapping
client.release()in atry...catchblock and ignoring the exception)?