Skip to content

Taskulu/Jiq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jiq (means "Scream" in Farsi) 😱

[swift 3]

There was a need in error handling with more details and more flexibility in Swift. I wrote my own Error wrapper so I could add more details to the errors.

This wrapper just makes my life easier! Hope does the same for you. 😬

Usage

Initialize a Jiq object like this:

let error = Jiq(code: 0, codeName:"WhatEverCodeNameYouWant", type: .unknown, message:"Something bad happened.")

Or like this:

let error = Jiq()

You can assign multiple details to the errors.

error.type = .badResponse

Here are some Jiq types:

  none
  badRequest
  badParameters
  badResponse
  notFound
  unknown

You can assing messages to the error like this:

error.message = "Something bad happened."

You can append the real Error object to it:

error.error = Error()

Installation

Simply drop the Jiq.swift file in your project or import this project to your workspace.

Please fork and contribute

About

A more useful error library in Swift

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published