implementation unaltered (just managing the NoBug handle)
based on the idea of a diagnostic context stack