[moniker] Capture and output error message (#5541)