Camelia Posted July 6, 2016 Report Posted July 6, 2016 Hello, steam-user docs has Event error Emitted when an error occurs during logon At the same time, logon.js component is throwing errors during logOn calls if(this.client.loggedOn) { throw new Error("Already logged on, cannot log on again"); }There are couple of places (2? 3?) where Error is thrown. Why this discrepancy? It feels like some of the Error could be emitted, thus allowing client (as client == developer) handle them in the way they prefer. Right now I would have to wrap calls to logOn in try catch. Do I miss use case here? Thank you! Quote
Dr. McKay Posted July 6, 2016 Report Posted July 6, 2016 I throw Errors in steam-user when you do something that you just shouldn't. For example, there are no cases where you should be trying to log on when you're already logged on. An Error being thrown basically means that you failed a precondition. For example, in the case quoted here, you need to check if you're already logged on before you attempt to log on again. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.