• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Visual Studio Code and try / catch statements

Participant ,
Nov 13, 2019 Nov 13, 2019

Copy link to clipboard

Copied

Hi!

 

I have recently moved from ESTK to visual studio code. I was making some changes to a existing script and when I executed it I got an error. If the option "Enable Javascript Debugger" is enabled, the try catch statements doesn't work, I have to disable it to be able to use the script. 

 

Does someone know why is this happening? A bug somewhere?

 

Cheers!

TOPICS
Error or problem , Scripting

Views

324

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 13, 2019 Nov 13, 2019

Copy link to clipboard

Copied

It probably boils down to some configuration stuff you have to set in Studio. try()catch{} constructs are alwayy handled by the underlying interpreter/ compiler/ byte engine an d only triggered if there is a genuine state error. If nothing is triggered, then it could mean the engine intercepts it beforehand or auto-corrects/ refactors your code in some way. I'm pretty sure it's explained in the Studio docs. A quick web search seems to indicate that you actually need to set the supported language levels in the external JSON configs along with some other options, so the alert level and in turn the response to such internal stuff may simply depend on that. Also of course keep in mind that all Adobe scripts represent a specific sub-type of ECMA/ JS Script and some constructs may never work as expected in a generic editor simply because they are not known and not specifically referenced in the libraries and dictionaries used for debugging.

 

Mylenium

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 13, 2019 Nov 13, 2019

Copy link to clipboard

Copied

LATEST

Thanks for your replay Mylenium!

I have done all the setup yes, and the debugger etc works fine, it's just that those try and catch statements.

 

Cheers!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines