KiCad PCB EDA Suite
IO_ERROR Class Reference

Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions containing meaningful error messages. More...

#include <ki_exception.h>

Inheritance diagram for IO_ERROR:
PARSE_ERROR FUTURE_FORMAT_ERROR

Public Member Functions

 IO_ERROR (const wxString &aProblem, const char *aThrowersFile, const char *aThrowersFunction, int aThrowersLineNumber)
 Constructor. More...
 
 IO_ERROR ()
 
void init (const wxString &aProblem, const char *aThrowersFile, const char *aThrowersFunction, int aThrowersLineNumber)
 
virtual const wxString Problem () const
 what was the problem? More...
 
virtual const wxString Where () const
 where did the Problem() occur? More...
 
virtual const wxString What () const
 A composite of Problem() and Where() More...
 
virtual ~IO_ERROR () throw ()
 

Protected Attributes

wxString problem
 
wxString where
 

Detailed Description

Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions containing meaningful error messages.

Author
Dick Hollenbeck

Definition at line 47 of file ki_exception.h.

Constructor & Destructor Documentation

IO_ERROR::IO_ERROR ( const wxString &  aProblem,
const char *  aThrowersFile,
const char *  aThrowersFunction,
int  aThrowersLineNumber 
)
inline

Constructor.

Parameters
aProblemis Problem() text.
aThrowersFileis the FILE preprocessor macro but generated at the source file of thrower.
aThrowersFunctionis the function name at the throw site.
aThrowersLineNumberis the source code line number of the throw.

Use macro THROW_IO_ERROR() to wrap a call to this constructor at the call site.

Definition at line 63 of file ki_exception.h.

References init().

65  {
66  init( aProblem, aThrowersFile, aThrowersFunction, aThrowersLineNumber );
67  }
void init(const wxString &aProblem, const char *aThrowersFile, const char *aThrowersFunction, int aThrowersLineNumber)
Definition: exceptions.cpp:56
IO_ERROR::IO_ERROR ( )
inline

Definition at line 69 of file ki_exception.h.

69 {}
virtual IO_ERROR::~IO_ERROR ( )
throw (
)
inlinevirtual

Definition at line 79 of file ki_exception.h.

79 {}

Member Function Documentation

void IO_ERROR::init ( const wxString &  aProblem,
const char *  aThrowersFile,
const char *  aThrowersFunction,
int  aThrowersLineNumber 
)

Definition at line 56 of file exceptions.cpp.

References problem, THROWERS_WHERE, and where.

Referenced by IO_ERROR().

57 {
58  problem = aProblem;
59 
60  // The throwers filename is a full filename, depending on Kicad source location.
61  // a short filename will be printed (it is better for user, the full filename has no meaning).
62  wxString srcname = aThrowersFile;
63 
64  where.Printf( THROWERS_WHERE, srcname.AfterLast( '/' ).GetData(),
65  wxString( aThrowersFunction ).GetData(), aThrowersLineNumber );
66 }
#define THROWERS_WHERE
Definition: exceptions.cpp:29
wxString where
Definition: ki_exception.h:83
wxString problem
Definition: ki_exception.h:82
const wxString IO_ERROR::Problem ( ) const
virtual

what was the problem?

Definition at line 49 of file exceptions.cpp.

References problem.

Referenced by FUTURE_FORMAT_ERROR::FUTURE_FORMAT_ERROR(), BOARD::TracksInNetBetweenPoints(), and What().

50 {
51  return problem;
52 }
wxString problem
Definition: ki_exception.h:82
const wxString IO_ERROR::What ( ) const
virtual

A composite of Problem() and Where()

Definition at line 33 of file exceptions.cpp.

References Problem(), and Where().

Referenced by CMP_TREE_MODEL_ADAPTER::AddAliasList(), CMP_TREE_MODEL_ADAPTER::AddLibrary(), PCBNEW_CONTROL::AppendBoard(), PCB_EDIT_FRAME::AppendBoardFile(), SCH_EDIT_FRAME::AppendSchematic(), PCB_EDIT_FRAME::ArchiveModulesOnBoard(), FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList(), DIALOG_PLOT_SCHEMATIC::CreateDXFFile(), DIALOG_PLOT_SCHEMATIC::createHPGLFile(), PCB_BASE_EDIT_FRAME::CreateNewLibrary(), DIALOG_PLOT_SCHEMATIC::createPDFFile(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), DIALOG_PLOT_SCHEMATIC::createPSFile(), DIALOG_PLOT_SCHEMATIC::createSVGFile(), FOOTPRINT_EDIT_FRAME::DeleteModuleFromCurrentLibrary(), SCH_BASE_FRAME::DisplayListComponentsInLib(), SCH_EDIT_FRAME::EditSheet(), PCB_EDIT_FRAME::Export_IDF3(), FOOTPRINT_EDIT_FRAME::Export_Module(), PCB_EDIT_FRAME::ExportSpecctraFile(), GPCB_PLUGIN::FootprintEnumerate(), PCB_IO::FootprintEnumerate(), ALIAS_INFO_GENERATOR::GenerateHtml(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), FOOTPRINT_EDIT_FRAME::Import_Module(), SCH_EDIT_FRAME::ImportFile(), PCB_EDIT_FRAME::ImportSpecctraSession(), FP_CACHE::Load(), GPCB_FPL_CACHE::Load(), PART_LIBS::LoadAllLibraries(), LIB_EDIT_FRAME::LoadComponentFromCurrentLib(), PCB_BASE_FRAME::loadFootprint(), PCB_BASE_FRAME::LoadFootprint(), SCH_LEGACY_PLUGIN::loadHierarchy(), PCB_BASE_FRAME::LoadModuleFromLibrary(), LIB_EDIT_FRAME::LoadOneSymbol(), main(), CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), LIB_EDIT_FRAME::OnExportPart(), KICAD_MANAGER_FRAME::OnImportEagleFiles(), LIB_EDIT_FRAME::OnImportPart(), APP_SINGLE_TOP::OnInit(), CV::IFACE::OnKifaceStart(), SCH::IFACE::OnKifaceStart(), PCB::IFACE::OnKifaceStart(), SCH_EDIT_FRAME::OnOpenLibraryEditor(), APP_SINGLE_TOP::OnRun(), APP_KICAD::OnRun(), KICAD_MANAGER_FRAME::OnRunPcbFpEditor(), KICAD_MANAGER_FRAME::OnRunSchLibEditor(), FOOTPRINT_EDIT_FRAME::OnSaveLibraryAs(), DIALOG_CHOOSE_COMPONENT::OnSchViewPaint(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), SYMBOL_GRID_TRICKS::paste_text(), FP_GRID_TRICKS::paste_text(), PROJECT::PcbFootprintLibs(), DIALOG_UPDATE_PCB::PerformUpdate(), DIALOG_CHOOSE_COMPONENT::PopulateFootprintSelector(), PCB_EDIT_FRAME::Process_Config(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), PCB_EDIT_FRAME::ReadPcbNetlist(), CVPCB_MAINFRAME::ReadSchematicNetlist(), GITHUB_GETLIBLIST::remoteGetJSON(), GITHUB_PLUGIN::remoteGetZip(), KICAD_MANAGER_FRAME::RunEeschema(), KICAD_MANAGER_FRAME::RunPcbNew(), FOOTPRINT_EDIT_FRAME::SaveCurrentModule(), SCH_EDIT_FRAME::SaveEEFile(), FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary(), LIB_EDIT_FRAME::SaveOneSymbol(), PCB_EDIT_FRAME::SavePcbCopy(), PCB_EDIT_FRAME::SavePcbFile(), SCH_BASE_FRAME::saveSymbolLibTables(), SchGetLibAlias(), WORKSHEET_LAYOUT::SetDefaultLayout(), WORKSHEET_LAYOUT::SetPageLayout(), DIALOG_CHOOSE_COMPONENT::ShowFootprintFor(), DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::TransferDataFromWindow(), DIALOG_NETLIST::verifyFootprints(), WORKSHEET_LAYOUT_FILEIO::WORKSHEET_LAYOUT_FILEIO(), WORKSHEET_LAYOUT_STRINGIO::WORKSHEET_LAYOUT_STRINGIO(), NETLIST_EXPORTER_KICAD::WriteNetlist(), and SYMBOL_LIB_TABLE_RESCUER::WriteRescueLibrary().

34 {
35 #ifdef DEBUG
36  return wxString( "IO_ERROR: " ) + Problem() + "\n\n" + Where();
37 #else
38  return Problem();
39 #endif
40 }
virtual const wxString Where() const
where did the Problem() occur?
Definition: exceptions.cpp:43
virtual const wxString Problem() const
what was the problem?
Definition: exceptions.cpp:49
const wxString IO_ERROR::Where ( ) const
virtual

where did the Problem() occur?

Definition at line 43 of file exceptions.cpp.

References where.

Referenced by What().

44 {
45  return where;
46 }
wxString where
Definition: ki_exception.h:83

Member Data Documentation

wxString IO_ERROR::problem
protected
wxString IO_ERROR::where
protected

Definition at line 83 of file ki_exception.h.

Referenced by init(), PARSE_ERROR::init(), and Where().


The documentation for this class was generated from the following files: