Archived Forum Post

Index of archived forum posts


Shorter error message

Jun 04 '14 at 05:32

I'm using the C++ HTTP component to download files from a HTTP server. I see that the CkHttp::lastErrorText() gives a commendably detailed error message, but it is too long and detailed for me to present to the user in our UI. Is there an easy way to get a one line error description instead, for example "ConnectFailReason: Connection Rejected" ?


The LastErrorText is intended to provide information for the application developer to resolve problems quickly. It's not designed for viewing by the non-technical end-user of an app.

Unfortunately, it's not so easy to decide internally within Chilkat as to what the one-line error would be. Chilkat will be investigating ways of choosing what one-line error is best, but I suspect even with that, it will end up being an uninformative error that basically amounts to knowing that the particular Chilkat method call failed and you'd need to look at the full detail of the LastErrorText to get proper context and details about what transpired.


I think most of the time just handing back the last error will do. "Connection refused" is pretty informative, as is "404 Not Found", or "Certificate validation failed" etc . I'm happy to log LastErrorText somewhere as well, and refer to that in case the user finds the one line error insufficient.


This feature is important for us, too.

I think, to add the function get_ConnectFailReason(), like in CkSocket or CkFtp2, would be a good first step. The same think in CkMailMan.