Picolab / pico-engine

An implementation of the pico-engine hosted on node.js
http://picolabs.io/
MIT License
43 stars 8 forks source link

function returns a map that contains the key "error" yields a red error message on Testing tab #518

Closed b1conrad closed 3 years ago

b1conrad commented 3 years ago

Is this by design?

Sample ruleset:

ruleset error {
  meta {
    shares error
  }
  global {
    error = function(msg) {
      {"error": msg || "sample error message","other":"stuff"}
    }
  }
}

/sky/cloud query for same from browser yields

b1conrad commented 3 years ago

This /sky/cloud query

http://localhost:3000/sky/cloud/ckj698dl6008ym62r9ymbbhdd/error/error?msg=Kilroy%20was%20here

yields

{"error":"Kilroy was here","other":"stuff"}

But the very same query done through the testing tab shows "Kilroy was here" in red and not the other stuff