[syserr.syserr.members]

# 19 Diagnostics library [[diagnostics]](./#diagnostics)

## 19.5 System error support [[syserr]](syserr#syserr.members)

### 19.5.8 Class system_error [[syserr.syserr]](syserr.syserr#members)

#### 19.5.8.2 Members [syserr.syserr.members]

[ð](#lib:system_error,constructor)

`system_error(error_code ec, const string& what_arg);
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1555)

*Postconditions*: code() == ec and  
string_view(what()).find(what_arg.c_str()) != string_view​::​npos[.](#1.sentence-1)

[ð](#lib:system_error,constructor_)

`system_error(error_code ec, const char* what_arg);
`

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1567)

*Postconditions*: code() == ec andstring_view(what()).find(what_arg) != string_view​::​npos[.](#2.sentence-1)

[ð](#lib:system_error,constructor__)

`system_error(error_code ec);
`

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1579)

*Postconditions*: code() == ec[.](#3.sentence-1)

[ð](#lib:system_error,constructor___)

`system_error(int ev, const error_category& ecat, const string& what_arg);
`

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1590)

*Postconditions*: code() == error_code(ev, ecat) and  
string_view(what()).find(what_arg.c_str()) != string_view​::​npos[.](#4.sentence-1)

[ð](#lib:system_error,constructor____)

`system_error(int ev, const error_category& ecat, const char* what_arg);
`

[5](#5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1602)

*Postconditions*: code() == error_code(ev, ecat) and  
string_view(what()).find(what_arg) != string_view​::​npos[.](#5.sentence-1)

[ð](#lib:system_error,constructor_____)

`system_error(int ev, const error_category& ecat);
`

[6](#6)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1614)

*Postconditions*: code() == error_code(ev, ecat)[.](#6.sentence-1)

[ð](#lib:code,system_error)

`const error_code& code() const noexcept;
`

[7](#7)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1625)

*Returns*: ec or error_code(ev, ecat), from the constructor,
as appropriate[.](#7.sentence-1)

[ð](#lib:what,system_error)

`const char* what() const noexcept override;
`

[8](#8)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1637)

*Returns*: An ntbs incorporating the arguments supplied in the constructor[.](#8.sentence-1)

[*Note [1](#note-1)*:

The returned ntbs might be the contents of what_arg + ": " + code.message()[.](#8.sentence-2)

â *end note*]
