InvalidOperationException instead of Exception in CodeBlockUtils: