?? myexception.pas
字號:
unit MyException;
interface
uses
SysUtils;
type
EAppendException = class(Exception)
public
constructor Create(const ClassName: string; const ErrMsg: string);
end;
ECancelException = class(Exception)
public
constructor Create(const ClassName: string; const ErrMsg: string);
end;
EDeleteException = class(Exception)
public
constructor Create(const ClassName: string; const ErrMsg: string);
end;
ESaveException = class(Exception)
public
constructor Create(const ClassName: string; const ErrMsg: string);
end;
EInitInstanceException = class(Exception)
public
constructor Create(const ClassName: string; const ErrMsg: string);
end;
EQueryParameters = class(Exception)
public
constructor Create(const ClassName: string; const ErrMsg: string);
end;
EOpenDataSetException = class(Exception)
public
constructor Create(const ClassName: string; const ErrMsg: string);
end;
EGetModelException = class(Exception)
public
constructor Create(const ViewName, FactoryName, ErrMsg: string);
end;
ELocateByPKException = class(Exception)
public
constructor Create(const ClassName, ErrMsg: string);
end;
ENewDataItemException = class(Exception)
public
constructor Create(const ClassName, ErrMsg: string);
end;
EParseToDataItemException = class(Exception)
public
constructor Create(const ClassName, ErrMsg: string);
end;
EViewCreateException = class(Exception)
public
constructor Create(const ClassName, ErrMsg: string);
end;
EInitViewException = class(Exception)
public
constructor Create(const ClassName, ErrMsg: string);
end;
ENewKeyException = class(Exception)
public
constructor Create(const ClassName, ErrMsg: string);
end;
implementation
{ AppendException }
constructor EAppendException.Create(const ClassName: string; const ErrMsg: string);
begin
inherited Create('當''' + ClassName + '''在插入一條新記錄時發生了錯誤,原因如下:' + #10 + ErrMsg);
end;
{ CancelException }
constructor ECancelException.Create(const ClassName, ErrMsg: string);
begin
inherited Create('當''' + ClassName + '''在放棄已修改數據時發生了錯誤,原因如下:' + #10 + ErrMsg);
end;
{ DeleteException }
constructor EDeleteException.Create(const ClassName, ErrMsg: string);
begin
inherited Create('當''' + ClassName + '''在刪除當前記錄時發生了錯誤,原因如下:' + #10 + ErrMsg);
end;
{ ESaveException }
constructor ESaveException.Create(const ClassName, ErrMsg: string);
begin
inherited Create('當''' + ClassName + '''在保存已個修改數據時發生了錯誤,原因如下:' + #10 + ErrMsg);
end;
{ EInitInstanceException }
constructor EInitInstanceException.Create(const ClassName, ErrMsg: string);
begin
inherited Create('在工廠類''' + ClassName + '''創建一個實例時發生了錯誤,原因如下:' + #10 + ErrMsg);
end;
{ EQueryParameters }
constructor EQueryParameters.Create(const ClassName, ErrMsg: string);
begin
inherited Create('在調用類''' + ClassName + '''的方法''Query''時發生了錯誤:' + #10 + ErrMsg +
#10 + '必須為''' + ClassName + '''傳遞一個''IQueryParameters''類型的參數');
end;
{ EOpenDataSetException }
constructor EOpenDataSetException.Create(const ClassName, ErrMsg: string);
begin
inherited Create('在類''' + ClassName + '''中打開某個數據集時發生了錯誤,原因如下:' + #10 + ErrMsg);
end;
{ EGetModelException }
constructor EGetModelException.Create(const ViewName, FactoryName, ErrMsg: string);
begin
inherited Create('在類''' + ViewName + '''中調用類''' + FactoryName + '''時發生了錯誤,原因如下:' + #10 + ErrMsg);
end;
{ ELocateByPKException }
constructor ELocateByPKException.Create(const ClassName, ErrMsg: string);
begin
inherited Create('在類''' + ClassName + '''中調用方法''LocateByPK''時發生了錯誤,原因如下:' + #10 + ErrMsg);
end;
{ ENewDataItemException }
constructor ENewDataItemException.Create(const ClassName, ErrMsg: string);
begin
inherited Create('在類''' + ClassName + '''中調用方法''NewDataItem''時發生了錯誤,原因如下:' + #10 + ErrMsg);
end;
{ EParseToDataItemException }
constructor EParseToDataItemException.Create(const ClassName, ErrMsg: string);
begin
inherited Create('在類''' + ClassName + '''中調用方法''ParseToDataItem''時發生了錯誤,原因如下:' + #10 + ErrMsg);
end;
{ EViewCreateException }
constructor EViewCreateException.Create(const ClassName, ErrMsg: string);
begin
inherited Create('在創建類''' + ClassName + '''時發生了錯誤,原因如下:' + #10 + ErrMsg);
end;
{ EInitViewException }
constructor EInitViewException.Create(const ClassName, ErrMsg: string);
begin
inherited Create('在類''' + ClassName + '''中調用方法''InitView''時發生了錯誤,原因如下:' + #10 + ErrMsg);
end;
{ ENewKeyException }
constructor ENewKeyException.Create(const ClassName, ErrMsg: string);
begin
inherited Create('在類''' + ClassName + '''中調用方法''NewKey''時發生了錯誤,原因如下:' + #10 + ErrMsg);
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -