InitError

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
mbillig02
Posts: 9
Joined: Sat 09 Feb 2019 23:16

InitError

Post by mbillig02 » Thu 06 Jun 2019 13:33

I am trying to return an error with text that I want and it does not appear to be working. Can I return text like below through InitError?

{========================================================================}
procedure TMainForm.ScSFTPServerMakeDirectory(Sender: TObject;
SFTPSessionInfo: TScSFTPSessionInfo; const Path: string;
var Error: TScSFTPError);
begin
// InfoMemo.Lines.Append(SFTPSessionInfo.Client.UserExtData);
if Pos('C',SFTPSessionInfo.Client.UserExtData) > 0 then
begin
ScSFTPServer.DefaultMakeDirectory(SFTPSessionInfo,Path,Error);
end
else
begin
InitError(Error, erPermissionDenied, '550 Can''t create directory. Permission denied');
end;
end;
{========================================================================}

ViktorV
Devart Team
Posts: 2807
Joined: Wed 30 Jul 2014 07:16

Re: InitError

Post by ViktorV » Thu 06 Jun 2019 14:13

You can use the code you provided to solve your task.
Note that to run this code, you should add the ScSFTPConsts unit to the USES clause of your unit.

Post Reply