Improve output error messages

When not enough data is written on an output, the related cache will be cleaned.

An error message must be shown to the user so he knows what is happening.