2 Replies Latest reply on Jul 20, 2013 3:55 PM by Los Morales

    Error handling from a reference interface

    Los Morales Newbie

      Hi,

       

      I have a composite service with a REST binding serving client requests.  How would you do error handling if something like invalid input parameters in the URL was specified?  For example the user only inputted one parameter where two was required:

       

       

      REST binding:

       

      @GET
      @Path("/authenticate/{username}/{password}")
      String authenticate(@PathParam("username") String username, @PathParam("password") String password);
      

       

       

      But the user only put:

      http://localhost:8080/switchyard-example/authenticate/username
      

       

       

      I was thinking that the composer that combines the username/password into a POJO would catch it if coded to check the needed 2 parameters.  However it seems to fail before it could reach the composer, i.e. at the above REST binding interface.  If invalid urls were used, I would like to handle it nicely with a message rather than an exception being displayed on the screen.  How would I do this?  TIA.