Uploaded image for project: 'CDAP'
  1. CDAP
  2. CDAP-4366

Stream Views RESTful API throws IAE instead of returning 404

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.3.0
    • Fix Version/s: 3.3.0
    • Component/s: API
    • Labels:
      None
    • Release Notes:
      Improved error message when stream views are not found.
    • Rank:
      1|hzz3sn:

      Description

      Despite what the docs claim, the Stream Views RESTful API returns an Java exception method rather than an appropriate error message:

      $ curl -vw'\n' -X GET 'http://localhost:10000/v3/namespaces/default/streams/stock_trades2/views/view2'
      *   Trying ::1...
      * Connected to localhost (::1) port 10000 (#0)
      > GET /v3/namespaces/default/streams/stock_trades2/views/view2 HTTP/1.1
      > Host: localhost:10000
      > User-Agent: curl/7.43.0
      > Accept: */*
      > 
      < HTTP/1.1 404 Not Found
      < Content-Type: text/plain; charset=utf-8
      < Content-Length: 91
      < Connection: keep-alive
      < 
      * Connection #0 to host localhost left intact
      'java.lang.IllegalArgumentException: Stream 'stock_trades2' does not exist.' was not found.
      
      $ curl -w'\n' -X GET 'http://localhost:10000/v3/namespaces/default/streams/stock_trades2/views/view2'
      'java.lang.IllegalArgumentException: Stream 'stock_trades2' does not exist.' was not found.
      
      $ curl -w'\n' -X GET 'http://localhost:10000/v3/namespaces/default/streams/stock_trades/views/view2'
      {"id":"view2","format":{"name":"csv","schema":{"type":"record","name":"rec","fields":[{"name":"num_traded","type":["int","null"]}]},"settings":{}},"tableName":"stream_stock_trades_view2"}
      
      $ curl -w'\n' -X GET 'http://localhost:10000/v3/namespaces/default/streams/stock_trades/views/view4'
      'stream_view:default.stock_trades' was not found.
      

      These messages aren't correct.

        Attachments

          Activity

            People

            • Assignee:
              alvin Alvin Wang
              Reporter:
              John John Jackson
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: