# Path: grace/error.py
# class CreateFolderError(Error):
#     pass
# 
# class FileNotWritableError(Error):
#     pass
# 
# class RemoveFolderError(Error):
#     pass


from builtins import object
from .error import CreateFolderError, FileNotWritableError, RemoveFolderError
from shutil import rmtree
import grace.py27.pyjsdoc
import os
                os.makedirs(self._config['build_path'])
            except:
                raise CreateFolderError('Could not create the project folder.')

        if os.path.exists(dest):
            try:
                rmtree(dest)
            except:
                raise RemoveFolderError('Could not remove the JSDoc folder.')

        try:
            os.makedirs(dest)
        except:
            raise CreateFolderError('Could not create the doc folder in your build directory.')

        if with_libs:
            jsdoc = pyjsdoc.CodeBaseDoc([source, self._lib_path])
        else:
            jsdoc = pyjsdoc.CodeBaseDoc([source])

        try:
            jsdoc.save_docs(output_dir=dest)
        except:
            raise FileNotWritableError('Could not write the docs to the build directory.')

        if self._doc_path is not None:
            if os.path.exists(self._doc_path):
                try:
                    rmtree(self._doc_path)
                except:

# Path: grace/error.py
# class CreateFolderError(Error):
#     pass
# 
# class FileNotWritableError(Error):
#     pass
# 
# class RemoveFolderError(Error):
#     pass


# Path: grace/doc.py
from builtins import object
from .error import CreateFolderError, FileNotWritableError, RemoveFolderError
from shutil import rmtree
import grace.py27.pyjsdoc
import os

                os.makedirs(self._config['build_path'])
            except:
                raise CreateFolderError('Could not create the project folder.')

        if os.path.exists(dest):
            try:
                rmtree(dest)
            except:
                raise RemoveFolderError('Could not remove the JSDoc folder.')

        try:
            os.makedirs(dest)
        except:
            raise CreateFolderError('Could not create the doc folder in your build directory.')

        if with_libs:
            jsdoc = pyjsdoc.CodeBaseDoc([source, self._lib_path])
        else:
            jsdoc = pyjsdoc.CodeBaseDoc([source])

        try:
            jsdoc.save_docs(output_dir=dest)
        except:
            raise FileNotWritableError('Could not write the docs to the build directory.')

        if self._doc_path is not None:
            if os.path.exists(self._doc_path):
                try:
                    rmtree(self._doc_path)
                except:

                    raise RemoveFolderError('Could not remove the current JSDoc folder.')