1
0
mirror of https://github.com/nerzhul/ownCloud-SMS-App.git synced 2025-07-23 18:06:05 +00:00

Add exception class for errors. Set error strings as a Android resource (for localization)

This commit is contained in:
Loïc Blot (@U-Exp) 2014-10-14 20:30:03 +02:00
parent 1328ebf4f3
commit 74c62e7f52
2 changed files with 35 additions and 0 deletions

View File

@ -96,4 +96,21 @@
<string name="sync_inprogress">Sync in progress...</string> <string name="sync_inprogress">Sync in progress...</string>
<string name="fatal_error">Fatal error ! </string> <string name="fatal_error">Fatal error ! </string>
<!-- Errors -->
<string name="err_sync_get_smslist">Error #1: Invalid data received from server when getting previous messages</string>
<string name="err_sync_craft_http_request">Error #2: Error while crafting HTTP request</string>
<string name="err_sync_push_request">Error #3: Push request failed</string>
<string name="err_sync_push_request_resp">Error #4: Invalid datas received from server when pushing datas</string>
<string name="err_sync_create_json_null_smslist">Error #5: NULL Sms List</string>
<string name="err_sync_create_json_put_smslist">Error #6: Error while crafting push request</string>
<string name="err_sync_create_json_request_encoding">Error #7: Unsupported encoding when generating request</string>
<string name="err_sync_auth_failed">Error #8: Authentication failed</string>
<string name="err_sync_http_request_returncode_unhandled">Error #9: Server set unhandled HTTP return code</string>
<string name="err_sync_http_request_connect">Error #11: Unable to perform a connection to ownCloud instance</string>
<string name="err_sync_http_request_httpexception">Error #12: Unable to perform a connection to ownCloud instance</string>
<string name="err_sync_http_request_ioexception">Error #13: Unable to perform a connection to ownCloud instance</string>
<string name="err_sync_http_request_resp">Error #14: Unable to parse server response</string>
<string name="err_sync_http_request_parse_resp">Error #15: Unable to parse server response</string>
</resources> </resources>

View File

@ -0,0 +1,18 @@
package fr.unix_experience.owncloud_sms.exceptions;
public class OCSyncException extends Exception {
/**
* Serial, generated by Eclipse to be compliant with JAVA
*/
private static final long serialVersionUID = -4277316598892180792L;
public OCSyncException(int errorId) {
_errorId = errorId;
}
public int getErrorId() {
return _errorId;
}
private int _errorId;
}