You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Misleading errors. The error detection process and the error message text should be improved to provide more informative details about the error's origin and its description.
#11
Open
OKhalkov opened this issue
Jun 7, 2023
· 0 comments
Example 1:
The error is in line 9; there is a missing ';' at the end. However, the error message incorrectly states that the issue is in line 10.
/** Decoder **///decodepayloadtostringvarpayloadStr=decodeToString(payload);//decodepayloadtoJSON//vardata=decodeToJson(payload);vardeviceName=payloadStr.substring(0,6)vardeviceType=payloadStr.substring(6,13);//Resultobjectwithdevice/assetattributes/telemetrydatavarresult={deviceName: deviceName,deviceType: deviceType,attributes: {},telemetry: {temperature: parseFloat(payloadStr.substring(13,17))}};/** Helper functions 'decodeToString' and 'decodeToJson' are already built-in **/returnresult;
Example 2:
The issue is in line 8, where a non-existing method is being called. However, the error message incorrectly states that the problem is in the first line.
/** Decoder **///decodepayloadtostringvarpayload=decodeToJson(payload);vardeviceName=payload["devName"];vardeviceType=payload.param1;varparam2=payload.param2.someNonExistingMethod();//Resultobjectwithdevice/assetattributes/telemetrydatavarresult={deviceName: deviceName,deviceType: deviceType,attributes: {},telemetry: {temperature: payload.param1,temp: payload["param2"].test,t: param2}};/** Helper functions 'decodeToString' and 'decodeToJson' are already built-in **/returnresult;
The text was updated successfully, but these errors were encountered:
Example 1:
The error is in line 9; there is a missing ';' at the end. However, the error message incorrectly states that the issue is in line 10.
Example 2:
The issue is in line 8, where a non-existing method is being called. However, the error message incorrectly states that the problem is in the first line.
The text was updated successfully, but these errors were encountered: