layout icon indicating copy to clipboard operation
layout copied to clipboard

Getting a layout error bricks the app

Open ayrtonsoftware opened this issue 5 years ago • 3 comments

My app allows the user to edit the layout and redisplay. But when an error happens, the whole windows is taken over and there is no way back to the code editor.

ayrtonsoftware avatar Nov 28 '18 20:11 ayrtonsoftware

@ayrtonsoftware you can disable the layout error console using LayoutConsole.isEnabled = false, or hide it programmatically using LayoutConsole.hide().

nicklockwood avatar Nov 28 '18 20:11 nicklockwood

@nicklockwood, thanks. This will work on getting rid of the console, but how to I get the errors? I will display them in my own UI. - Thanks

I am doing this:

self.loadLayout(withContentsOfURL: viewModel.path) { (error: LayoutError?) in print(error?.description) print(error?.localizedDescription) print(error?.suggestions) }

but the error is always nil....

ayrtonsoftware avatar Nov 30 '18 05:11 ayrtonsoftware

@ayrtonsoftware the error parameter only catches errors that occur during loading. To catch other errors you will need to implement the func layoutError(_ error: LayoutError) delegate method in your Layout ViewController.

nicklockwood avatar Nov 30 '18 11:11 nicklockwood