Completed
Push — master ( fba866...b10a48 )
by Ori
03:03
created

DataSourceException::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 2
1
<?php
2
namespace frictionlessdata\tableschema\Exceptions;
3
4
/**
5
 * this exception should be raised from DataSourceInterface classes
6
 * it will usually represent some kind of file system error in reading
7
 * or an error in matching value to a column
8
 */
9
class DataSourceException extends \Exception
10
{
11
    public function __construct($message, $rowNum=0)
12
    {
13
        if (!empty($rowNum)) $message = "row {$rowNum}: {$message}";
14
        parent::__construct($message);
15
    }
16
}
17