The Wayback Machine - https://web.archive.org/web/20200907115502/https://github.com/opencomponents/oc/issues/492/
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

Handling failed render in oc-client #492

Open
zoilorys opened this issue May 26, 2017 · 2 comments
Open

Handling failed render in oc-client #492

zoilorys opened this issue May 26, 2017 · 2 comments

Comments

@zoilorys
Copy link

@zoilorys zoilorys commented May 26, 2017

So there is pretty much no way to tell that component failed to render for some reason, outside of error in console, but thats not really helpful.

The whole solution will be something like

// oc-client.js:382
oc.renderByHref($component.attr('href'), function(err, data){
    if(err || !data){
-      $component.html('');
+     $component
+         .attr('data-rendering', 'false')
+         .attr('data-rendered', 'false')
+         .html('');
+      oc.events.fire('oc:failed', { originalError: err, data: data });
        logger.error(err);
        return callback();
    }

    processHtml($component, data, callback);
});
@matteofigus
Copy link
Member

@matteofigus matteofigus commented Jun 14, 2017

@zoilorys sorry for the huge delay on answering to this.
I think your idea of firing a new event with the details is very good.
Would you be able to attempt a PR with this?
Thanks!

@nickbalestra
Copy link
Contributor

@nickbalestra nickbalestra commented Jul 23, 2017

@zoilorys I like the idea.
FYI: we recently moved the oc-client-browser code in its own repo -> https://github.com/opencomponents/oc-client-browser/ would you like to attempt a PR there? Happy to help if you need anything to make this happen!

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

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.