throw error when message format is not as expected