[module] Fix exception stack trace printing