DocumentBuilder icon indicating copy to clipboard operation
DocumentBuilder copied to clipboard

Document Builder Web API silent fails on script errors

Open neerax opened this issue 5 years ago • 1 comments

Affected environment: docker image onlyoffice/documentserver, id -> fc79eb363184f43ff73e3c2c9cec42786395fb56cf11e05cf40a5dd7dc4aba5c

When serving to docbuilder endpoint a script with errors the service returns:

{ key: 'bld_acaba810114356ab', urls: {}, end: true }

note the empty urls response, http status is 200 too, nothing is reported in docker logs. It'expected to have an error code (-1 or -3 I guess) with additional information to help fixing.

Example script:

builder.SetTmpFolder("DocBuilderTemp");
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph;
oParagraph = Api.CreateParagraph();
oParagraph.SetJc("center");
oParagraph.AddText("Center");
oDocument.Push(oParagraph);
oSection = oDocument.GetFinalSection();
oSection.SetPageMargins(720, 720, 720, 720);
oSection.setPageSize(11952,16848);
builder.SaveFile("docx", "images.docx");
builder.CloseFile();

Note setPageSize should be SetPageSize.

This is painfull to debug. Regards

neerax avatar Apr 07 '21 15:04 neerax

Thanks for noticing, I've created issue 49537 in our private issue tracker

ShockwaveNN avatar Apr 08 '21 07:04 ShockwaveNN