[Debug] fix handling deprecated warnings and stacked errors turned into exceptions