Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Truncate error messages #311

Closed
mattgodbolt opened this issue Mar 7, 2017 · 10 comments
Closed

Truncate error messages #311

mattgodbolt opened this issue Mar 7, 2017 · 10 comments

Comments

@mattgodbolt
Copy link
Member

E.g. putting this code: template<class T>class L{L<T*>operator->()};L<int>i=i-> in the view kills the browser...

@mattgodbolt mattgodbolt added the bug label Mar 7, 2017
@dreamzor
Copy link

dreamzor commented Mar 7, 2017

@mattgodbolt
Copy link
Member Author

"Works" on the beta site. Generates a jolly large error message:

$ curl 'https://gcc.godbolt.org/api/compiler/g63/compile?options=-Wall' --data-binary 'template<class T>class L{L<T*>operator->()};L<int>i=i->' | wc
   6292   27269  822287

I think the error message needs truncating a tiny bit earlier.

@mattgodbolt
Copy link
Member Author

Couldn't reproduce (via https://godbolt.org/g/ujv6gi ) though I think truncating the error output is still sensible. Renaming bug and making a feature.

@mattgodbolt mattgodbolt changed the title Some code causes browser hang Truncate error messages Jan 11, 2018
@mattgodbolt mattgodbolt added the good first issue Easy & accessible label Jan 11, 2018
@dwcraig
Copy link

dwcraig commented Apr 21, 2018

I'd be happy to work on this. Is there a preferred length to truncate the error messages to?

@RubenRBS
Copy link
Member

I think that the best solution would be to make it configurable via the .properties files, so 3rd party users can set it to match their needs

@dwcraig
Copy link

dwcraig commented May 4, 2018

I am able to truncate the error message coming from the compiler response in static/compiler.js, but I am unsure how I would access the property to allow the response length to be configured.
Would it be possible for someone to point me in the right direction?

@jaredwy
Copy link
Contributor

jaredwy commented May 4, 2018

Take a look at the config files in ‘etc/‘ I would drop a new property in the default one and load it as a config option. Have a look at ‘app.js’. It loads the config options there. then use this to truncate the error string.

@dwcraig
Copy link

dwcraig commented May 4, 2018

Thanks. The part that I am stuck on is loading it as a config option. Sorry, my comment was unclear. I added truncateErrorMessages=20 to compiler-explorer.defaults.properties. I am not sure where or how I should load that as a config option.

@dwcraig
Copy link

dwcraig commented May 4, 2018

Thanks @jaredwy and @RabsRincon. I've got it so that the number of lines can be truncated by the amount set in the .properties files. What would be a good value to set the default to when there is nothing set by a user?

@RubenRBS RubenRBS removed the good first issue Easy & accessible label Mar 29, 2021
@partouf partouf added probably-wont-happen PRs are welcomed, but we do not currently plan on implementing this and removed probably-wont-happen PRs are welcomed, but we do not currently plan on implementing this labels Mar 29, 2021
@partouf
Copy link
Contributor

partouf commented Mar 29, 2021

This was truncated on the serverside a long time ago, so this is actually fixed

@partouf partouf closed this as completed Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants