Alpine-DAV/ascent

error not forwarded as a exception

cyrush opened this issue · 4 comments

The following actions are malformed:

- 
  action: "add_pipelines"
  pipelines: 
    pl1: 
      f1:
- 
  action: "add_scenes"
  scenes: 
    s1: 
      plots: 
        p1: 
          type: "pseudocolor"
          field: "pl"
          pipeline: "pl1"
- 
  action: "save_info"

However the error will not trigger an exception when we try to forward:

Node opts;
opts["exceptions"]="forward";
ascent.open(opts)

This will:

Sounds like we need to check for empy pipeline

- 
  action: "add_pipelines"
  pipelines: 
    pl1: 
      f1:
         type: "garbage"
- 
  action: "add_scenes"
  scenes: 
    s1: 
      plots: 
        p1: 
          type: "pseudocolor"
          field: "pl"
          pipeline: "pl1"
- 
  action: "save_info"

@emily-howell -- this is the issue I mentioned in our last meeting.

@cyrush Great. I will take a look at this!

@cyrush I think I am miss-understanding the bug here.

If I run this:

    Ascent ascent;
    Node ascent_opts;
    ascent_opts["exceptions"] = "forward";
    ascent.open(ascent_opts);

    conduit::Node pipelines;
    pipelines["pl1/f1/type"] = "garbage";
    pipelines.remove("pl1/f1/type");

    conduit::Node scenes;
    scenes["s1/plots/p1/type"]  = "pseudocolor";
    scenes["s1/plots/p1/field"] = "pl";
    scenes["s1/plots/p1/pipeline"] = "pl1";

    conduit::Node actions;
    // add the pipeline
    conduit::Node &add_pipelines= actions.append();
    add_pipelines["action"] = "add_pipelines";
    add_pipelines["pipelines"] = pipelines;
    // add the scenes
    conduit::Node &add_scenes= actions.append();
    add_scenes["action"] = "add_scenes";
    add_scenes["scenes"] = scenes;
    // save info
    conduit::Node &save_info= actions.append();
    save_info["action"] = "save_info";

    std::cout << actions.to_yaml() << std::endl;

    ascent.execute(actions);
    ascent.close();

I get this out when I print out the actions:

  - 
    action: "add_pipelines"
    pipelines: 
      pl1: 
        f1: 
  
  - 
    action: "add_scenes"
    scenes: 
      s1: 
        plots: 
          p1: 
            type: "pseudocolor"
            field: "pl"
            pipeline: "pl1"
  - 
    action: "save_info"

which looks to me like it matches the malformed actions you posted above.

I get the following failure when I run that code:

unknown file: Failure
C++ exception with description "
file: /path/to/ascent/src/libs/ascent/runtimes/ascent_main_runtime.cpp
line: 882
message: 
Filter must declare a 'type'
" thrown in the test body.

Let try this one:

(w/o a filter specified)

- 
  action: "add_pipelines"
  pipelines: 
    pl1: 
- 
  action: "add_scenes"
  scenes: 
    s1: 
      plots: 
        p1: 
          type: "pseudocolor"
          field: "pl"
          pipeline: "pl1"
- 
  action: "save_info"