add exception for invalid parameter errors

This commit is contained in:
Robin Appelman 2017-08-17 16:02:17 +02:00
commit 443a524491
3 changed files with 14 additions and 2 deletions

View file

@ -15,7 +15,7 @@ class ErrorCodes {
const BadHostName = 'NT_STATUS_BAD_NETWORK_NAME'; const BadHostName = 'NT_STATUS_BAD_NETWORK_NAME';
const Unsuccessful = 'NT_STATUS_UNSUCCESSFUL'; const Unsuccessful = 'NT_STATUS_UNSUCCESSFUL';
const ConnectionRefused = 'NT_STATUS_CONNECTION_REFUSED'; const ConnectionRefused = 'NT_STATUS_CONNECTION_REFUSED';
const NoLogonServers = 'NT_STATUS_NO_LOGON_SERVERS'; const NoLogonServers = 'NT_STATUS_NO_LOGON_SERVERS';
const PathNotFound = 'NT_STATUS_OBJECT_PATH_NOT_FOUND'; const PathNotFound = 'NT_STATUS_OBJECT_PATH_NOT_FOUND';
const NoSuchFile = 'NT_STATUS_NO_SUCH_FILE'; const NoSuchFile = 'NT_STATUS_NO_SUCH_FILE';
@ -26,4 +26,5 @@ class ErrorCodes {
const FileIsADirectory = 'NT_STATUS_FILE_IS_A_DIRECTORY'; const FileIsADirectory = 'NT_STATUS_FILE_IS_A_DIRECTORY';
const NotADirectory = 'NT_STATUS_NOT_A_DIRECTORY'; const NotADirectory = 'NT_STATUS_NOT_A_DIRECTORY';
const SharingViolation = 'NT_STATUS_SHARING_VIOLATION'; const SharingViolation = 'NT_STATUS_SHARING_VIOLATION';
const InvalidParameter = 'NT_STATUS_INVALID_PARAMETER';
} }

View file

@ -0,0 +1,10 @@
<?php
/**
* Copyright (c) 2014 Robin Appelman <icewind@owncloud.com>
* This file is licensed under the Licensed under the MIT license:
* http://opensource.org/licenses/MIT
*/
namespace Icewind\SMB\Exception;
class InvalidParameterException extends InvalidRequestException {}

View file

@ -39,7 +39,8 @@ class Parser {
ErrorCodes::DirectoryNotEmpty => '\Icewind\SMB\Exception\NotEmptyException', ErrorCodes::DirectoryNotEmpty => '\Icewind\SMB\Exception\NotEmptyException',
ErrorCodes::FileIsADirectory => '\Icewind\SMB\Exception\InvalidTypeException', ErrorCodes::FileIsADirectory => '\Icewind\SMB\Exception\InvalidTypeException',
ErrorCodes::NotADirectory => '\Icewind\SMB\Exception\InvalidTypeException', ErrorCodes::NotADirectory => '\Icewind\SMB\Exception\InvalidTypeException',
ErrorCodes::SharingViolation => '\Icewind\SMB\Exception\FileInUseException' ErrorCodes::SharingViolation => '\Icewind\SMB\Exception\FileInUseException',
ErrorCodes::InvalidParameter => '\Icewind\SMB\Exception\InvalidParameterException'
]; ];
/** /**