Posflow
September 21, 2021, 11:36am
1
Hi guys,
how do you generally go around debugging JScripts?
Its really difficult to guess whats wrong when all I get is this.
Memo
September 21, 2021, 1:25pm
2
Wrap it in a try/catch block
examples:
aww and I just was able to catch the exception
System.Net.WebException: The remote server returned an error: (401) Unauthorized.
[2021-03-10_15;47_1615412834_Samba.Presentation]
In the future you can use tryCatch to display exceptions thrown:
function test()
{
var lib = host.lib("System");
var client = new lib.System.Net.WebClient();
var request = "{\"message\":[{\"source\":\"php\",\"body\":\"Jelly liquorice\",\"to\":\"+6141111111\"}]}";
client.Headers.Add("Authorizatio…
Reformatting the datetimes works on my end.
here’s the table DDL I used to mock:
IF OBJECT_ID('dbo.Payments') IS NOT NULL
DROP TABLE dbo.Payments
GO
CREATE TABLE dbo.Payments
(
PaymentDate DATETIMEOFFSET,
PaymentId NVARCHAR(255),
ExternalPaymentId NVARCHAR(255),
InvoiceNumber NVARCHAR(255),
CardAuthCode NVARCHAR(255),
TransactionNumber NVARCHAR(255),
Note NVARCHAR(255),
Tender NVARCHAR(255),
CardBrand NVARCHAR(255),
CardNumber INT,
CardEntryType NVARCHAR(255),
Curren…
3 Likes
JTRTech
September 21, 2021, 3:24pm
3
I usually end up commenting out chunks to narrow down the problem line but is slow process.
Posflow
September 22, 2021, 1:37am
4
Yeah, thats what Ive been doing but its incredibly tedious and difficult to work with. Is there a compiler/interpreter I can use with JScript that will help me at least a little bit?
I am trying to use JScript and import .NET system and network libraries to open sockets and as you can imagine its near impossible without decent debugging tools.
@Memo thanks! Ill have a look at that
Memo
September 22, 2021, 2:09am
5
I just happened on to that code earlier this year. I found calling the debugger and launching visual studio did nothing for me.