Skip to content

Commit d941f96

Browse files
committed
Change some errors to be runtime errors
1 parent 6c13d89 commit d941f96

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/ast.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,15 +342,15 @@ namespace Sass {
342342
{
343343
if (Selector_List_Ptr_Const sl = dynamic_cast<Selector_List_Ptr_Const>(this)) return *sl == rhs;
344344
if (Simple_Selector_Ptr_Const sp = dynamic_cast<Simple_Selector_Ptr_Const>(this)) return *sp == rhs;
345-
throw "invalid selector base classes to compare";
345+
throw std::runtime_error("invalid selector base classes to compare");
346346
return false;
347347
}
348348

349349
bool Selector::operator< (const Selector& rhs) const
350350
{
351351
if (Selector_List_Ptr_Const sl = dynamic_cast<Selector_List_Ptr_Const>(this)) return *sl < rhs;
352352
if (Simple_Selector_Ptr_Const sp = dynamic_cast<Simple_Selector_Ptr_Const>(this)) return *sp < rhs;
353-
throw "invalid selector base classes to compare";
353+
throw std::runtime_error("invalid selector base classes to compare");
354354
return false;
355355
}
356356

src/context.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ namespace Sass {
562562
}
563563

564564
// abort early if no content could be loaded (various reasons)
565-
if (!contents) throw "File to read not found or unreadable: " + input_path;
565+
if (!contents) throw std::runtime_error("File to read not found or unreadable: " + input_path);
566566

567567
// store entry path
568568
entry_path = abs_path;

src/extend.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,11 +1627,11 @@ namespace Sass {
16271627
SourcesSet debugSet;
16281628
debugSet = pNewSelector->sources();
16291629
if (debugSet.size() > 0) {
1630-
throw "The new selector should start with no sources. Something needs to be cloned to fix this.";
1630+
throw std::runtime_error("The new selector should start with no sources. Something needs to be cloned to fix this.");
16311631
}
16321632
debugSet = pExtComplexSelector->sources();
16331633
if (debugSet.size() > 0) {
1634-
throw "The extension selector from our subset map should not have sources. These will bleed to the new selector. Something needs to be cloned to fix this.";
1634+
throw std::runtime_error("The extension selector from our subset map should not have sources. These will bleed to the new selector. Something needs to be cloned to fix this.");
16351635
}
16361636
#endif
16371637

src/subset_map.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace Sass {
66

77
void Subset_Map::put(const Compound_Selector_Obj& sel, const Subset_Map_Val& value)
88
{
9-
if (sel->empty()) throw "internal error: subset map keys may not be empty";
9+
if (sel->empty()) throw std::runtime_error("internal error: subset map keys may not be empty");
1010
size_t index = values_.size();
1111
values_.push_back(value);
1212
for (size_t i = 0, S = sel->length(); i < S; ++i)

0 commit comments

Comments
 (0)