Skip to content

Commit

Permalink
better handling of login failure
Browse files Browse the repository at this point in the history
  • Loading branch information
icewind1991 committed Aug 16, 2017
1 parent bc257e8 commit e1438ac
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,16 @@ class Parser {
// todo replace with static once <5.6 support is dropped
// see error.h
private static $exceptionMap = [
ErrorCodes::PathNotFound => '\Icewind\SMB\Exception\NotFoundException',
ErrorCodes::ObjectNotFound => '\Icewind\SMB\Exception\NotFoundException',
ErrorCodes::NoSuchFile => '\Icewind\SMB\Exception\NotFoundException',
ErrorCodes::NameCollision => '\Icewind\SMB\Exception\AlreadyExistsException',
ErrorCodes::AccessDenied => '\Icewind\SMB\Exception\AccessDeniedException',
ErrorCodes::DirectoryNotEmpty => '\Icewind\SMB\Exception\NotEmptyException',
ErrorCodes::FileIsADirectory => '\Icewind\SMB\Exception\InvalidTypeException',
ErrorCodes::NotADirectory => '\Icewind\SMB\Exception\InvalidTypeException',
ErrorCodes::SharingViolation => '\Icewind\SMB\Exception\FileInUseException'
ErrorCodes::LogonFailure => AuthenticationException::class,
ErrorCodes::PathNotFound => NotFoundException::class,
ErrorCodes::ObjectNotFound => NotFoundException::class,
ErrorCodes::NoSuchFile => NotFoundException::class,
ErrorCodes::NameCollision => AlreadyExistsException::class,
ErrorCodes::AccessDenied => AccessDeniedException::class,
ErrorCodes::DirectoryNotEmpty => NotEmptyException::class,
ErrorCodes::FileIsADirectory => InvalidTypeException::class,
ErrorCodes::NotADirectory => InvalidTypeException::class,
ErrorCodes::SharingViolation => FileInUseException::class
];

/**
Expand Down

0 comments on commit e1438ac

Please sign in to comment.