Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AjaxUploader not actually throwing exceptions #440

Closed
patriksh opened this issue Nov 17, 2021 · 11 comments
Closed

AjaxUploader not actually throwing exceptions #440

patriksh opened this issue Nov 17, 2021 · 11 comments

Comments

@patriksh
Copy link
Contributor

public function handleUpload($uploadFilename, $replace = false)

No exceptions are thrown, it just returns an error in an array.
This doesn't trigger the try/catch block in ajax controller.

@navjottomer
Copy link
Member

It only has two lines where this can happen, not all errors throw exceptions.

$size = $this->file->getSize();

if ($this->file->save($uploadFilename)) {

@patriksh
Copy link
Contributor Author

But if the image is e.g. too big, the code just continues because an error array is returned and nothing is done with it.

@navjottomer
Copy link
Member

Hmm, that can be fixed.

@patriksh
Copy link
Contributor Author

In my api I just made it throw an exception if isset($result['error']).

@navjottomer
Copy link
Member

create a pull then I'll merge.

@patriksh
Copy link
Contributor Author

Can do tomorrow.

@navjottomer
Copy link
Member

I also request you to help me clean up https://github.com/mindstellar/shopclass as some of the code is legacy and not needed anymore. In your free time if possible.

@patriksh
Copy link
Contributor Author

Do you plan to make it the default theme at some point? Not sure how I feel about all the integrated features as a part of a theme.

@navjottomer
Copy link
Member

Nope, not default just an alternative. Some features need integration in osclass itself and some need removal altogether. I have created them as some features were not available with osclass nor any plugin was available to provide those features at the time.

@eurobank
Copy link

eurobank commented Nov 18, 2021

@dftd I highly disagree. Plugins will come maybe late and right now a real theme is needed to PROMOTE the use of Osclass of this release channel.

I think that move from @navjottomer is excellent (to offer this theme for free, since it was NOT free). But apparently some changes are needed to work with 5.1. I can't help coding but i surely can help a lot in testing.

@eurobank
Copy link

@navjottomer What happened with the Shopclass theme? Freezed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants