Edited error message raised from class/module

Re: #16468