simonihmig / ember-native-dom-helpers-codemod

Codemod to transform your jQuery based ember tests to use ember-native-dom-helpers
MIT License
27 stars 9 forks source link

Reproduce error. If you uncomment this line everything breaks. #14

Closed cibernox closed 7 years ago

cibernox commented 7 years ago

@knownasilya I've isolated the problem to the last line on this test. If this line is uncommented something goes wrong.

@simonihmig Do you know if there is a way of try/catch transformations so if we attempt to parse something and we fail, we can recover and just continue to transform the file instead of just crashing and leave the file unmodified?

simonihmig commented 7 years ago

@cibernox I think one easy win would be to at least continue with other transforms in https://github.com/simonihmig/ember-native-dom-helpers-codemod/blob/master/lib/presets/-preset.js, by try/catching any exception and continuing with the other transforms.

Will try this, thanks for tracking this down!

cibernox commented 7 years ago

If you try catch, log some sort of error like:

Transformation <transformation-name> errored on file <file-name>. Reason <error-message>. Please report this in <repo-url>
simonihmig commented 7 years ago

Merged this, will try to fix this now!