Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
UnknownError example
$result
=
$archive
->
close
(
)
;
if
(
!
$result
)
{
throw
new
DriverException
(
'Zip archive could not be closed.'
)
;
}
try
{
$remotePath
=
$this
->
getWebDriverSession
(
)
->
file
(
[
'file' =>
base64_encode
(
file_get_contents
(
$tempFilename
)
)
]
)
;
// If no path is returned the file upload failed silently.
if
(
empty
(
$remotePath
)
)
{
throw
new
UnknownError
(
)
;
}
}
catch
(
\Exception
$e
)
{
throw
$e
;
}
finally
{
unlink
(
$tempFilename
)
;
}
return
$remotePath
;
}