CheckDir Error

Hi, I have to do something with the ionic native class File. It works generally, so for example I get the dataDirectory correctly but if I want to use the method checkDir() I get an error: "code":1,"message":"NOT_FOUND_ERR"
The code:

this.file.checkDir(this.file.dataDirectory, "Exercises").then((resolve) => {
            alert("result: " + resolve)
            if (!resolve) {
                //do something
            } 
        }, (error) => {
            alert("error: " + JSON.stringify(error));
        }) 

And one more question: Do I have to use .then always if I have a promise? Even at methods like createDir?
I would appreciate any answer! :slight_smile:

If you have code that needs to be certain that the operation has completed, yes.

1 Like

But if it should just do something and I don’t care about when it is ready or if it is ready, then I don’t have to use .then, right?
2. Do you know why the error occurs?