Forum Discussion

id-chalmers's avatar
11 years ago

freemarker error handling in rest api

I'm using the rest api (which is great, thanks!) to create a custom component, pulling recently solved messages from a large number of boards on my community. The rest call references boards by id, a...
  • PaoloT's avatar
    11 years ago

    Hi id-chalmers 

     

    have you tried with the attempt / recover freemarker directive?

     

    <#attempt>
    <#assign board = rest("boards/id/iDoNotExist").board />
    <#recover>
    Something went wrong
    </#attempt>
    

     

    Hope it helps