Handle 'Target file not found' in our custom plugin/dita framework

Hi, When handling conrefs to objects that no longer exist in our CMS, we would like to handle this the same way as regular dita files with the same issue. E.g <note id="GUID-364D534C-E105-4CA7-81B5-FA910387D630" conref="./Jenkins/nonexistingfile.dita"> Results in a '[Target file not found]' error with more details when you hover over. For the moment we return a new File(tothenonexistingpath) in getCanonicalFileFromFileUrl, which results in the erro: xxx\GUID-C2F39B76-FDC6-4E7C-80E1-36E7BC635FBA (The system cannot find the file specified) Is there a way we can raise the same error from our custom code? Kind regards, Pascal www.sdl.com SDL PLC confidential, all rights reserved. If you are not the intended recipient of this mail SDL requests and requires that you delete it without acting upon or copying any of its contents, and we further request that you advise us. SDL PLC is a public limited company registered in England and Wales. Registered number: 02675207. Registered address: SDL PLC, New Globe House, Vanwall Business Park, Vanwall Road, Maidenhead, SL6 4UB, U.K.

Hi Pascal, Maybe when your URLConnection.getInputStream() is called for an URL to a non existing resource you could throw a " FileNotFoundException" which extends IOException. About your remark:
For the moment we return a new File(tothenonexistingpath) in getCanonicalFileFromFileUrl where in the code is that? In your custom url connection handler? Can you give me more details?
Regards, Radu On 2/6/18 5:01 PM, Pascal Beutels wrote:
Hi,
When handling conrefs to objects that no longer exist in our CMS, we would like to handle this the same way as regular dita files with the same issue.
E.g
<noteid="GUID-364D534C-E105-4CA7-81B5-FA910387D630"conref="./Jenkins/nonexistingfile.dita">
Results in a ‘[Target file not found]’ error with more details when you hover over.
For the moment we return a new File(tothenonexistingpath) in getCanonicalFileFromFileUrl, which results in the erro:
xxx\GUID-C2F39B76-FDC6-4E7C-80E1-36E7BC635FBA (The system cannot find the file specified)
Is there a way we can raise the same error from our custom code?
Kind regards,
Pascal
*www.sdl.com* <http://www.sdl.com/>
SDL PLC confidential, all rights reserved. If you are not the intended recipient of this mail SDL requests and requires that you delete it without acting upon or copying any of its contents, and we further request that you advise us. SDL PLC is a public limited company registered in England and Wales. Registered number: 02675207. Registered address: SDL PLC, New Globe House, Vanwall Business Park, Vanwall Road, Maidenhead, SL6 4UB, U.K.
_______________________________________________ oXygen-sdk mailing list oXygen-sdk@oxygenxml.com https://www.oxygenxml.com/mailman/listinfo/oxygen-sdk
-- Radu Coravu Oxygen XML Editor
participants (2)
-
Pascal Beutels
-
Radu Coravu