class FileError

Declaration

class FileError : public ErrorInfo { /* full declaration omitted */ };

Description

This class wraps a filename and another Error. In some cases, an error needs to live along a 'source' name, in order to show more detailed information to the user.

Declared at: llvm/include/llvm/Support/Error.h:1263

Inherits from: ErrorInfo

Member Variables

private std::string FileName
private Optional<size_t> Line
private std::unique_ptr<ErrorInfoBase> Err
public static char ID

Method Overview

  • private FileError(const llvm::Twine & F, Optional<size_t> LineNum, std::unique_ptr<ErrorInfoBase> E)
  • private static llvm::Error build(const llvm::Twine & F, Optional<size_t> Line, llvm::Error E)
  • public std::error_code convertToErrorCode() const
  • public llvm::StringRef getFileName() const
  • public void log(llvm::raw_ostream & OS) const
  • public std::string messageWithoutFileInfo() const
  • public llvm::Error takeError()

Methods

FileError(const llvm::Twine& F,
          Optional<size_t> LineNum,
          std::unique_ptr<ErrorInfoBase> E)

Declared at: llvm/include/llvm/Support/Error.h:1294

Parameters

const llvm::Twine& F
Optional<size_t> LineNum
std::unique_ptr<ErrorInfoBase> E

static llvm::Error build(const llvm::Twine& F,
                         Optional<size_t> Line,
                         llvm::Error E)

Declared at: llvm/include/llvm/Support/Error.h:1302

Parameters

const llvm::Twine& F
Optional<size_t> Line
llvm::Error E

std::error_code convertToErrorCode() const

Description

Convert this error to a std::error_code. This is a temporary crutch to enable interaction with code still using std::error_code. It will be removed in the future.

Declared at: llvm/include/llvm/Support/Error.h:1288

llvm::StringRef getFileName() const

Declared at: llvm/include/llvm/Support/Error.h:1284

void log(llvm::raw_ostream& OS) const

Description

Print an error message to an output stream.

Declared at: llvm/include/llvm/Support/Error.h:1269

Parameters

llvm::raw_ostream& OS

std::string messageWithoutFileInfo() const

Declared at: llvm/include/llvm/Support/Error.h:1277

llvm::Error takeError()

Declared at: llvm/include/llvm/Support/Error.h:1286