At the moment it is not possible to save error conditions in a way they can be recreated seamlessly. If a second error condition occurs in the same scope the first one is lost and can not be propagated anymore. To overcome this issue the PROPAGATE keyword needs to be enhanced by an optional keyword CONDITION that is followed by a directory. This directory can be obtained with the internal function condition("O").
signal on syntax
... code issuing a syntax error
cond = condition("O")
signal on user UserError
... more code issuing UserError
raise propagate condition (cond)