if message contains `error' -> 'error, if it contains `warning' -> 'warning, else -> 'error