forked from MarcWeber/phamlp
-
Notifications
You must be signed in to change notification settings - Fork 83
/
SassException.php
executable file
·36 lines (34 loc) · 1.06 KB
/
SassException.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/**
* General Sass exception.
*
* @author Chris Yates <chris.l.yates@gmail.com>
* @copyright Copyright (c) 2010 PBM Web Development
* @license http://phamlp.googlecode.com/files/license.txt
* @package PHamlP
* @subpackage Sass
*/
/**
* Sass exception class.
*
* @package PHamlP
* @subpackage Sass
*/
class SassException extends Exception {
/**
* Sass Exception.
*
* @param string $message Exception message
* @param mixed $additionalMessageMixed mixed resource for meta data
*/
public function __construct($message, $additionalMessageMixed = '') {
if (is_object($additionalMessageMixed)) {
$additionalMessageMixed = ": {$additionalMessageMixed->filename}::{$additionalMessageMixed->line}\nSource: {$additionalMessageMixed->source}";
} else if (is_array($additionalMessageMixed)) {
$additionalMessageMixed = var_export($additionalMessageMixed, TRUE);
} else if (!is_scalar($additionalMessageMixed)) {
$additionalMessageMixed = '';
}
parent::__construct($message . $additionalMessageMixed);
}
}