[fs.filesystem.error.members]

# 31 Input/output library [[input.output]](./#input.output)

## 31.12 File systems [[filesystems]](filesystems#fs.filesystem.error.members)

### 31.12.7 Class filesystem_error [[fs.class.filesystem.error]](fs.class.filesystem.error#fs.filesystem.error.members)

#### 31.12.7.2 Members [fs.filesystem.error.members]

[1](#1)

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

Constructors are provided that store zero, one, or two paths associated with
an error[.](#1.sentence-1)

[ð](#lib:filesystem_error,constructor)

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

[2](#2)

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

*Postconditions*: 

- [(2.1)](#2.1)

code() == ec is true,

- [(2.2)](#2.2)

path1().empty() is true,

- [(2.3)](#2.3)

path2().empty() is true, and

- [(2.4)](#2.4)

string_view(what()).find(what_arg.c_str()) != string_view​::​npos is true[.](#2.sentence-1)

[ð](#lib:filesystem_error,constructor_)

`filesystem_error(const string& what_arg, const path& p1, error_code ec);
`

[3](#3)

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

*Postconditions*: 

- [(3.1)](#3.1)

code() == ec is true,

- [(3.2)](#3.2)

path1() returns a reference to the stored copy of p1,

- [(3.3)](#3.3)

path2().empty() is true, and

- [(3.4)](#3.4)

string_view(what()).find(what_arg.c_str()) != string_view​::​npos is true[.](#3.sentence-1)

[ð](#lib:filesystem_error,constructor__)

`filesystem_error(const string& what_arg, const path& p1, const path& p2, error_code ec);
`

[4](#4)

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

*Postconditions*: 

- [(4.1)](#4.1)

code() == ec,

- [(4.2)](#4.2)

path1() returns a reference to the stored copy of p1,

- [(4.3)](#4.3)

path2() returns a reference to the stored copy of p2, and

- [(4.4)](#4.4)

string_view(what()).find(what_arg.c_str()) != string_view​::​npos[.](#4.sentence-1)

[ð](#lib:path1,filesystem_error)

`const path& path1() const noexcept;
`

[5](#5)

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

*Returns*: A reference to the copy of p1 stored by the
 constructor, or, if none, an empty path[.](#5.sentence-1)

[ð](#lib:path2,filesystem_error)

`const path& path2() const noexcept;
`

[6](#6)

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

*Returns*: A reference to the copy of p2 stored by the
 constructor, or, if none, an empty path[.](#6.sentence-1)

[ð](#lib:what,filesystem_error)

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

[7](#7)

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

*Returns*: An ntbs that incorporates
 the what_arg argument supplied to the constructor[.](#7.sentence-1)

The exact format is unspecified[.](#7.sentence-2)

Implementations should include
 the system_error​::​what() string and
 the pathnames of path1 and path2 in the native format in the returned string[.](#7.sentence-3)
