[feature/migrations] Use getLocalisedMessage() function to get error message

PHPBB3-11318