mirror of
				https://github.com/nerzhul/ownCloud-SMS-App.git
				synced 2025-10-30 18:07:51 +00:00 
			
		
		
		
	Add exception class for errors. Set error strings as a Android resource (for localization)
This commit is contained in:
		
							parent
							
								
									1328ebf4f3
								
							
						
					
					
						commit
						74c62e7f52
					
				| @ -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> | ||||||
|  | |||||||
| @ -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; | ||||||
|  | } | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user