i'm trying to use the contentResource.getById(id) to check if a certain document exists from angularjs in a property editor. But I get a 404 and an red error in the backend, if the node doesn't exist.
i have tried try catch around it - but it still shows an error.
i've also thought about the possibility of changing the "then" to "ifSuccess" or something like that, but can't find any documentation on this.
handle contentResource 404 error
hi,
i'm trying to use the contentResource.getById(id) to check if a certain document exists from angularjs in a property editor. But I get a 404 and an red error in the backend, if the node doesn't exist.
i have tried try catch around it - but it still shows an error.
i've also thought about the possibility of changing the "then" to "ifSuccess" or something like that, but can't find any documentation on this.
how do i handle when the node doesn't exist?
Hi Tom
You should be able to handle it like this
Does this work for you?
/Jan
hi jan
thanks - that worked. now i can handle the errors - but is there any way to kill the build-in error overlay thingy?
Hi Tom
Hmm, I'm not sure the defaults can be overwritten but if it can I suppose it should be mentioned here http://umbraco.github.io/Belle/#/api/umbraco.services.dialogService (Have only skimmed it myself though).
Hope this helps.
/Jan
created my own webapi to check if the documents exists
Hi Tom
Cool - Glad you got it all working :)
/Jan
is working on a reply...