Skip to content

Review errortype branch #2

@richardhodgson

Description

@richardhodgson

Following on from my comment... https://github.com/tomyan/use.no.de/issues/2#issuecomment-1414209

I've added an error type to Spectrum, in a branch:
master...errortypes

It allows you do something like this in your code:

spectrum.loadTemplate('does-not-exist.spv').then(
    function () {
        // all is fine...
    },
    function (e) {
        if (e.type == spectrum.errors.couldNotReadTemplate) {
            // handle missing template 
        }
        else {
            // some other error
        }
    }
);

What do you think?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions