diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-10-29 10:40:32 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-25 10:36:24 +0100 |
commit | ddad9afe45df39465b121058cbd9fcf900aa3367 (patch) | |
tree | d2d802ff3ab333f2a15f81f472d2bd8ef04f22bc /examples | |
parent | 8bb5528c99641bd9bbfdf39da8326807d76235aa (diff) | |
download | qtenginio-ddad9afe45df39465b121058cbd9fcf900aa3367.tar.gz |
Add basic error handling to example
Change-Id: I23fd6ecba4c5718241d8d2a508ee24910d4d8fa9
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/quick/todos/doc/src/todos.qdoc | 3 | ||||
-rw-r--r-- | examples/quick/todos/todo.qml | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/examples/quick/todos/doc/src/todos.qdoc b/examples/quick/todos/doc/src/todos.qdoc index 79b7ffc..7d5d954 100644 --- a/examples/quick/todos/doc/src/todos.qdoc +++ b/examples/quick/todos/doc/src/todos.qdoc @@ -54,6 +54,9 @@ The first step is to create an \l{Enginio1::EnginioModel} and the Enginio instance with the backend configuration. + To get nice debug output in case something goes wrong, the onError signal in + Enginio is handled. Since the error is a JSON object, JSON.stringify is used + to format it to a string. \snippet todos/todo.qml model diff --git a/examples/quick/todos/todo.qml b/examples/quick/todos/todo.qml index dfc2ef4..23ad46e 100644 --- a/examples/quick/todos/todo.qml +++ b/examples/quick/todos/todo.qml @@ -54,6 +54,7 @@ Rectangle { id: enginioModel client: Enginio { backendId: enginioBackendId + onError: console.log("Enginio error:", JSON.stringify(reply.data)) } query: {"objectType": "objects.todos" } } |