
rest:report-error( $error as element() ) as element()
This function formats the specified error structure.
| Parameters | |
|---|---|
| error | The error structure to be formatted. | 
  xquery version "1.0-ml"; 
 
  import module namespace rest="http://marklogic.com/appservices/rest"
      at "/MarkLogic/appservices/utils/rest.xqy";
  try {
     let $params := rest:process-request($request)
     return
       ...the non-error case...
   } catch ($e) {
       rest:report-error($e)
   }
 
    
  
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.