Change error function

The error function now has the functionality decided upon in https://clever.atlassian.net/browse/INFRA-52