Drupal set message class
For drupal set message below is a syntax.

drupal_set_message($message = NULL, $type = 'status', $repeat = TRUE);


Parameters

string $message: (optional) The translated message to be displayed to the user. For consistency with other messages, it should begin with a capital letter and end with a period.

string $type: (optional) The message's type. Defaults to 'status'. These values are supported:

'status'

'warning'

'error'

You should pass any one of the status message with your custom class separated with space as shown below

drupal_set_message(t('an error has occured'),' status custom-error');