public function deleteTemporaryFile() { try { @unlink($this->tmpFileName); return tink_core_Outcome::Success(tink_core_Noise::$Noise); } catch (Exception $__hx__e) { $_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e; $e = $_ex_; return tink_core_Outcome::Failure(tink_core_TypedError::withData(null, "Error during TmpFileUpload.deleteTmpFile()", $e, _hx_anonymous(array("fileName" => "TmpFileUpload.hx", "lineNumber" => 165, "className" => "ufront.web.upload.TmpFileUpload", "methodName" => "deleteTemporaryFile")))); } }
static function catchExceptions($f, $report = null) { try { return tink_core_Outcome::Success(call_user_func($f)); } catch (Exception $__hx__e) { $_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e; if (($e = $_ex_) instanceof tink_core_TypedError) { return tink_core_Outcome::Failure($e); } else { $e1 = $_ex_; return tink_core_Outcome::Failure($report === null ? tink_core_TypedError::withData(null, "Unexpected Error", $e1, _hx_anonymous(array("fileName" => "Error.hx", "lineNumber" => 97, "className" => "tink.core.TypedError", "methodName" => "catchExceptions"))) : call_user_func_array($report, array($e1))); } } }
function sys_ufront_web_context_HttpRequest_7(&$_g, &$callbackFutures, &$currentContent, &$doData, &$doEndOfPart, &$doPart, &$e, &$errors, &$fileName, &$isFile, &$noParts, &$onData, &$onEndPart, &$onPart, &$partName, &$processCallbackResult, $_5) { if ($errors->length === 0) { $data3 = tink_core_Outcome::Success(tink_core_Noise::$Noise); return tink_core__Future_Future_Impl_::sync($data3); } else { $data4 = tink_core_Outcome::Failure(tink_core_TypedError::withData(null, "Error parsing multipart request data", $errors, _hx_anonymous(array("fileName" => "HttpRequest.hx", "lineNumber" => 174, "className" => "sys.ufront.web.context.HttpRequest", "methodName" => "parseMultipart")))); return tink_core__Future_Future_Impl_::sync($data4); } }
static function remotingError($error, $pos = null) { switch ($error->index) { case 0: $responseData = _hx_deref($error)->params[2]; $responseCode = _hx_deref($error)->params[1]; $remotingCallString = _hx_deref($error)->params[0]; return tink_core_TypedError::typed($responseCode, "HTTP " . _hx_string_rec($responseCode, "") . " Error during " . _hx_string_or_null($remotingCallString), $error, $pos); break; case 1: $errorMessage = _hx_deref($error)->params[1]; $remotingCallString1 = _hx_deref($error)->params[0]; return tink_core_TypedError::typed(404, "Remoting API " . _hx_string_or_null($remotingCallString1) . " not found: " . _hx_string_or_null($errorMessage), $error, $pos); break; case 2: $stack = _hx_deref($error)->params[2]; $e = _hx_deref($error)->params[1]; $remotingCallString2 = _hx_deref($error)->params[0]; $errorObj = Std::instance($e, _hx_qtype("tink.core.TypedError")); if ($errorObj !== null) { return tink_core_TypedError::typed($errorObj->code, $errorObj->message, $error, $pos); } else { return tink_core_TypedError::typed(500, "Internal Server Error while executing " . _hx_string_or_null($remotingCallString2), $error, $pos); } break; case 3: $e1 = _hx_deref($error)->params[1]; $remotingCallString3 = _hx_deref($error)->params[0]; return tink_core_TypedError::typed(500, "Error during callback after " . _hx_string_or_null($remotingCallString3) . ": " . Std::string($e1), $error, $pos); break; case 4: $err = _hx_deref($error)->params[2]; $troubleLine = _hx_deref($error)->params[1]; $remotingCallString4 = _hx_deref($error)->params[0]; return tink_core_TypedError::typed(422, "Remoting serialization failed for call " . _hx_string_or_null($remotingCallString4) . ": could not process " . _hx_string_or_null($troubleLine), $error, $pos); break; case 5: $responseData1 = _hx_deref($error)->params[1]; $remotingCallString5 = _hx_deref($error)->params[0]; return tink_core_TypedError::typed(500, "Error with response for " . _hx_string_or_null($remotingCallString5) . ": no remoting response found", $error, $pos); break; case 6: $data = _hx_deref($error)->params[1]; $remotingCallString6 = _hx_deref($error)->params[0]; return tink_core_TypedError::typed(500, "Call to " . _hx_string_or_null($remotingCallString6) . " failed: " . Std::string($data), $error, $pos); break; case 7: $e2 = _hx_deref($error)->params[0]; return tink_core_TypedError::typed(500, "Unknown exception during remoting call", $error, $pos); break; } }
function ufront_core_CallbackTools_2(&$cb, &$pos, &$t, $error, $val1, $val2) { if ($error !== null) { $e = tink_core_TypedError::withData(500, "" . Std::string($error), $pos, _hx_anonymous(array("fileName" => "AsyncTools.hx", "lineNumber" => 266, "className" => "ufront.core.CallbackTools", "methodName" => "asSurprisePair"))); $result = tink_core_Outcome::Failure($e); if ($t->{"list"} === null) { false; } else { $list = $t->{"list"}; $t->{"list"} = null; $t->result = $result; tink_core__Callback_CallbackList_Impl_::invoke($list, $result); tink_core__Callback_CallbackList_Impl_::clear($list); true; } } else { $result1 = tink_core_Outcome::Success(new tink_core_MPair($val1, $val2)); if ($t->{"list"} === null) { false; } else { $list1 = $t->{"list"}; $t->{"list"} = null; $t->result = $result1; tink_core__Callback_CallbackList_Impl_::invoke($list1, $result1); tink_core__Callback_CallbackList_Impl_::clear($list1); true; } } }
function ufront_view_UFViewEngine_4(&$_g, &$ext, &$finalPath, &$path, &$templatingEngine, &$tplStrReady, $tplStr) { try { $tpl4 = $templatingEngine->factory($tplStr); $v = new tink_core_MPair($templatingEngine->type, $tpl4); $_g->cache->set($path, $v); $v; return tink_core_Outcome::Success($tpl4); } catch (Exception $__hx__e) { $_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e; $e = $_ex_; return tink_core_Outcome::Failure(tink_core_TypedError::withData(null, "Failed to pass template " . _hx_string_or_null($finalPath) . " using " . _hx_string_or_null($templatingEngine->type), $e, _hx_anonymous(array("fileName" => "UFViewEngine.hx", "lineNumber" => 187, "className" => "ufront.view.UFViewEngine", "methodName" => "getTemplate")))); } }