The following SCRI that import an object returns error code 0, even if the task ended with an error.
:SET &EXPORTFILE# = "/home/admin/test.xml"
:SET &IMPORTFOLDER# = "\AUTOMIC\MYFOLDER"
:SET &RET# = IMPORT('&EXPORTFILE#','&IMPORTFOLDER#','1')
Make sure the object type of the object in the XML is not allowed for the user that executes the script.
This is the Report:
2022-11-28 13:33:46 - U04005755 Starting import of object 'TEST'
2022-11-28 13:33:46 - U00000009 'TEST': Access denied
2022-11-28 13:33:46 - U04005751 Error when importing object
2022-11-28 13:33:46 - U00020408 0000000000000000
Release : 21.0.3
Engineering confirmed that this is a bug. A fix will be delivered in a future version of the product.