Consider this question here as an example. The question here contains a Screenshot which describes the error code.
Example Screenshot present in the question :
I believe that adding the error code as a text in such questions would be useful. This would improve the search presence of the question (text inside the images cannot be indexed by search engines). This would make sense seeing the fact that Stackexchange sites are supposed to get 90% of their traffic from Search engines[Ref].
But on the other hand this is minor edit which will not improve the readability of the question. I know such edits are not discouraged by the community.
Can we allow edits that adds error code to the questions from screenshots? Or should such edits be avoided?