agentlang-ai / agentlang

Generative AI-powered Programming Language
Apache License 2.0
117 stars 4 forks source link

bug: `:throws` syntax not working for nested dataflows #1461

Closed muazzam0x48 closed 1 month ago

muazzam0x48 commented 1 month ago
 {:Sbqq.Salesforce/SBQQ__QuoteLine__c
  {:SBQQ__Quote__c? :quote.Id}
  :throws
  [:error {:SubmitOrderResult
           {:Status "Error", :Message "Error fetching quote line information"}}
   :not-found {:SubmitOrderResult
               {:Status "Error", :Message "Quote lines not found for quote"}}]
  :as :QL}

Given this query in SubmitOrder dataflow, it works, being on top level of the dataflow.

However, moving it in match block after :as :PendingOrder:

The dataflow compiles fine but on calling that dataflow, I get this error:

{
    "reason": "cannot compile map literal {:Sbqq.Salesforce/SBQQ__QuoteLine__c {:SBQQ__Quote__c? :quote.Id}, :throws [:error {:Checkout.Backend.Core/SubmitOrderResult {:Status \"Error\", :Message \"Error fetching quote line information\"}} :not-found {:Checkout.Backend.Core/SubmitOrderResult {:Status \"Error\", :Message \"Quote lines not found for quote\"}}], :as :QL}"
}