Skip to content

Commit 19898d5

Browse files
committed
refactor: Add new exception UnknownRecordType
1 parent 4178379 commit 19898d5

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/Exceptions/UnknownRecordType.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace Scriptotek\Marc\Exceptions;
4+
5+
class UnknownRecordType extends \RuntimeException
6+
{
7+
}

src/Record.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use File_MARC_Record;
66
use File_MARC_Reference;
77
use Scriptotek\Marc\Exceptions\RecordNotFound;
8+
use Scriptotek\Marc\Exceptions\UnknownRecordType;
89

910
class Record
1011
{
@@ -97,7 +98,7 @@ public function getType()
9798
case 'y': // Serial item holdings
9899
return Marc21::HOLDINGS;
99100
default:
100-
throw new \ErrorException('Unknown record type.');
101+
throw new UnknownRecordType();
101102
}
102103
}
103104

0 commit comments

Comments
 (0)