错误处理 Alamofire

Alamofire 对错误的处理考虑使用枚举,只要结果可能是有限的集合的情况下,其实枚举本身还是数据的一种载体,swift中,枚举有着很丰富的使用方法.
先总结一下swfit中enum中的用法:

1.正常用法

enum Movement {
    case Left
    case Right
    case Top
    case Bottom
}
let aMovement = Movement.Left
switch aMovement {
case .Left:
    print("left")
default:
    print("Unknow")
}
if case .Left = aMovement {
    print("Left")
}
if .Left == aMovement {
    print("Left")
}

2.声明为整型

enum Season: Int {
    case Spring = 0
    case Summer = 1
    case Autumn = 2
    case Winter = 3
}

.3.声明为字符串类型

enum House: String {
    case ZhangSan = "I am zhangsan"
    case LiSi = "I am lisi"
}
let zs = House.ZhangSan
print(zs.rawValue)
enum CompassPoint: String {
case North, South, East, West
}
let n = CompassPoint.North

4.声明为浮点类型

enum Constants: Double {
    case π = 3.14159
    case e = 2.71828
    case φ = 1.61803398874
    case λ = 1.30357
}
let pai = Constants.π
print(pai.rawValue)

5.其他类型

enum VNodeFlags : UInt32 {
    case Delete = 0x00000001
    case Write = 0x00000002
    case Extended = 0x00000004
    case Attrib = 0x00000008
    case Link = 0x00000010
    case Rename = 0x00000020
    case Revoke = 0x00000040
    case None = 0x00000080
}

6.enum包含enum

enum Character {

    enum Weapon {
        case Bow
        case Sword
        case Lance
        case Dagger
    }

    enum Helmet {
        case Wooden
        case Iron
        case Diamond
    }

    case Thief
    case Warrior
    case Knight
}

7.结构体和枚举

struct Scharacter {
    enum CharacterType {
        case Thief
        case Warrior
        case Knight
    }
    enum Weapon {
        case Bow
        case Sword
        case Lance
        case Dagger
    }
    let type: CharacterType
    let weapon: Weapon
}
let sc = Scharacter(type: .Thief, weapon: .Bow)
print(sc.type)

8.值关联

enum Trade {
    case Buy(stock: String, amount: Int)
    case Sell(stock: String, amount: Int)
}
let trade = Trade.Buy(stock: "Car", amount: 100)
if case let Trade.Buy(stock, amount) = trade {
    print("buy \(amount) of \(stock)")
}
enum Trade0 {
    case Buy(String, Int)
    case Sell(String, Int)
}
let trade0 = Trade0.Buy("Car0", 100)
if case let Trade0.Buy(stock, amount) = trade0 {
    print("buy \(amount) of \(stock)")
}

9.枚举中的函数

enum Wearable {
    enum Weight: Int {
        case Light = 2
    }

    enum Armor: Int {
        case Light = 2
    }

    case Helmet(weight: Weight, armor: Armor)


    func attributes() -> (weight: Int, armor: Int) {
        switch self {
        case .Helmet(let w, let a):
            return (weight: w.rawValue * 2, armor: a.rawValue * 4)

        }
    }
}

let test = Wearable.Helmet(weight: .Light, armor: .Light).attributes()
print(test)

enum Device {
    case iPad, iPhone, AppleTV, AppleWatch
    func introduced() -> String {
        switch self {
        case .AppleTV: return "\(self) was introduced 2006"
        case .iPhone: return "\(self) was introduced 2007"
        case .iPad: return "\(self) was introduced 2010"
        case .AppleWatch: return "\(self) was introduced 2014"
        }
    }
}
print (Device.iPhone.introduced())

10.枚举中的属性

enum Device1 {
    case iPad, iPhone
    var year: Int {
        switch self {
        case .iPad:
            return 2010
        case .iPhone:
            return 2007
    }
    }
}

let iPhone = Device1.iPhone
print(iPhone.year)

ParameterEncodingFailureReason

通过ParameterEncodingFailureReason我们能够很清楚的看出来这是一个参数编码的错误原因。大家注意reason这个词,在命名中,有或者没有这个词,表达的意境完全不同,因此,Alamofire牛逼就体现在这些细节之中。

public enum AFError: Error {
    /// The underlying reason the parameter encoding error occurred.
    ///
    /// - missingURL:                 The URL request did not have a URL to encode.
    /// - jsonEncodingFailed:         JSON serialization failed with an underlying system error during the
    ///                               encoding process.
    /// - propertyListEncodingFailed: Property list serialization failed with an underlying system error during
    ///                               encoding process.
    public enum ParameterEncodingFailureReason {
        case missingURL
        case jsonEncodingFailed(error: Error)
        case propertyListEncodingFailed(error: Error)
    }
 }

ParameterEncodingFailureReason本身是一个enum,同时,它又被包含在AFError之中,这说明枚举之中可以有另一个枚举。那么像这种情况我们怎么使用呢?看下边的代码:

let parameterErrorReason = AFError.ParameterEncodingFailureReason.missingURL

枚举的访问是一级一级进行的。我们再看这行代码:case jsonEncodingFailed(error: Error)。jsonEncodingFailed(error: Error)并不是函数,就是枚举的一个普通的子选项。(error: Error)是它的一个关联值,相对于任何一个子选项,我们都可以关联任何值,它的意义就在于,把这些值与子选项进行绑定,方便在需要的时候调用。我们会在下边讲解如何获取关联值。

参数编码有一下几种方式:

把参数编码到URL中
把参数编码到httpBody中
Alamofire中是如何进行参数编码的,这方面的内容会在后续的ParameterEncoding.swift这一篇文章中给出详细的解释。那么编码失败的原因可能为:

missingURL 给定的urlRequest.url为nil的情况抛出错误
jsonEncodingFailed(error: Error) 当选择把参数编码成JSON格式的情况下,参数JSON化抛出的错误
propertyListEncodingFailed(error: Error) 这个同上
综上所述,ParameterEncodingFailureReason封装了参数编码的错误,可能出现的错误类型为Error,说明这些所谓一般是调用系统Api产生的错误。

MultipartEncodingFailureReason

public enum MultipartEncodingFailureReason {
        case bodyPartURLInvalid(url: URL)
        case bodyPartFilenameInvalid(in: URL)
        case bodyPartFileNotReachable(at: URL)
        case bodyPartFileNotReachableWithError(atURL: URL, error: Error)
        case bodyPartFileIsDirectory(at: URL)
        case bodyPartFileSizeNotAvailable(at: URL)
        case bodyPartFileSizeQueryFailedWithError(forURL: URL, error: Error)
        case bodyPartInputStreamCreationFailed(for: URL)

        case outputStreamCreationFailed(for: URL)
        case outputStreamFileAlreadyExists(at: URL)
        case outputStreamURLInvalid(url: URL)
        case outputStreamWriteFailed(error: Error)

        case inputStreamReadFailed(error: Error)
    }

多部分编码错误一般发生在上传或下载请求中对数据的处理过程中,这里边最重要的是对上传数据的处理过程,会在后续的MultipartFormData.swift这一篇文章中给出详细的解释,我们就简单的分析下MultipartEncodingFailureReason子选项错误出现的原因:

bodyPartURLInvalid(url: URL) 上传数据时,可以通过fileURL的方式,读取本地文件数据,如果fileURL不可用,就会抛出这个错误
bodyPartFilenameInvalid(in: URL) 如果使用fileURL的lastPathComponent或者pathExtension获取filename为空抛出的错误
bodyPartFileNotReachable(at: URL) 通过fileURL不能访问数据,也就是不可达的
bodyPartFileNotReachableWithError(atURL: URL, error: Error) 这个不同于bodyPartFileNotReachable(at: URL),当尝试检测fileURL是不是可达的情况下抛出的错误
bodyPartFileIsDirectory(at: URL) 当fileURL是一个文件夹时抛出错误
bodyPartFileSizeNotAvailable(at: URL) 当使用系统Api获取fileURL指定文件的size出现错误
bodyPartFileSizeQueryFailedWithError(forURL: URL, error: Error) 查询fileURL指定文件size出现错误
bodyPartInputStreamCreationFailed(for: URL) 通过fileURL创建inputStream出现错误
outputStreamCreationFailed(for: URL) 当尝试把编码后的数据写入到硬盘时,创建outputStream出现错误
outputStreamFileAlreadyExists(at: URL) 数据不能被写入,因为指定的fileURL已经存在
outputStreamURLInvalid(url: URL) fileURL不是一个file URL
outputStreamWriteFailed(error: Error) 数据流写入错误
inputStreamReadFailed(error: Error) 数据流读入错误
综上所述,这些错误基本上都跟数据的操作相关,这个在后续会做出很详细的说明。

ResponseValidationFailureReason

public enum ResponseValidationFailureReason {
        case dataFileNil
        case dataFileReadFailed(at: URL)
        case missingContentType(acceptableContentTypes: [String])
        case unacceptableContentType(acceptableContentTypes: [String], responseContentType: String)
        case unacceptableStatusCode(code: Int)
    }

Alamofire不管请求是否成功,都会返回response。它提供了验证ContentType和StatusCode的功能,关于验证,再后续的文章中会有详细的解答,我们先看看这些原因:

dataFileNil 保存数据的URL不存在,这种情况一般出现在下载任务中,指的是下载代理中的fileURL缺失
dataFileReadFailed(at: URL) 保存数据的URL无法读取数据,同上
missingContentType(acceptableContentTypes: [String]) 服务器返回的response不包含ContentType且提供的acceptableContentTypes不包含通配符(通配符表示可以接受任何类型)
unacceptableContentType(acceptableContentTypes: [String], responseContentType: String) ContentTypes不匹配
unacceptableStatusCode(code: Int) StatusCode不匹配

ResponseSerializationFailureReason

public enum ResponseSerializationFailureReason {
    case inputDataNil
    case inputDataNilOrZeroLength
    case inputFileNil
    case inputFileReadFailed(at: URL)
    case stringSerializationFailed(encoding: String.Encoding)
    case jsonSerializationFailed(error: Error)
    case propertyListSerializationFailed(error: Error)
}

我们在上篇中已经提到,Alamofire支持把服务器的response序列成几种数据格式。

response 直接返回HTTPResponse,未序列化
responseData 序列化为Data
responseJSON 序列化为Json
responseString 序列化为字符串
responsePropertyList 序列化为Any
那么在序列化的过程中,很可能会发生下边的错误:

inputDataNil 服务器返回的response没有数据
inputDataNilOrZeroLength 服务器返回的response没有数据或者数据的长度是0
inputFileNil 指向数据的URL不存在
inputFileReadFailed(at: URL) 指向数据的URL无法读取数据

AFError

上边内容中介绍的ParameterEncodingFailureReason MultipartEncodingFailureReason ResponseValidationFailureReason和 ResponseSerializationFailureReason,他们是定义在AFError中独立的枚举,他们之间是包含和被包含的关系,理解这一点很重要,因为有了这种包含的管理,在使用中就需要通过AFError.ParameterEncodingFailureReason这种方式进行操作。

那么最重要的问题就是,如何把上边4个独立的枚举进行串联呢?Alamofire巧妙的地方就在这里,有4个独立的枚举,分别代表4大错误。也就是说这个网络框架肯定有这4大错误模块,我们只需要给AFError设计4个子选项,每个子选项关联上上边4个独立枚举的值就ok了。

这个设计真的很巧妙,试想,如果把所有的错误都放到AFError中,就显得非常冗余。那么下边的代码就呼之欲出了,大家好好体会体会在swift下这么设计的妙用:

case invalidURL(url: URLConvertible)
case parameterEncodingFailed(reason: ParameterEncodingFailureReason)
case multipartEncodingFailed(reason: MultipartEncodingFailureReason)
case responseValidationFailed(reason: ResponseValidationFailureReason)
case responseSerializationFailed(reason: ResponseSerializationFailureReason)

AFError的扩展

也许在开发中,我们完成了上边的代码就认为够用了,但对于一个开源框架而言,远远是不够的。我们一点点进行剖析:

现在给定一条数据:

 func findErrorType(error: AFError) {

  }

我只需要知道这个error是不是参数编码错误,应该怎么办?因此为AFError提供5个布尔类型的属性,专门用来获取当前的错误是不是某个指定的类型。这个功能的实现比较简单,代码如下:

extension AFError {
    /// Returns whether the AFError is an invalid URL error.
    public var isInvalidURLError: Bool {
        if case .invalidURL = self { return true }
        return false
    }

    /// Returns whether the AFError is a parameter encoding error. When `true`, the `underlyingError` property will
    /// contain the associated value.
    public var isParameterEncodingError: Bool {
        if case .parameterEncodingFailed = self { return true }
        return false
    }

    /// Returns whether the AFError is a multipart encoding error. When `true`, the `url` and `underlyingError` properties
    /// will contain the associated values.
    public var isMultipartEncodingError: Bool {
        if case .multipartEncodingFailed = self { return true }
        return false
    }

    /// Returns whether the `AFError` is a response validation error. When `true`, the `acceptableContentTypes`,
    /// `responseContentType`, and `responseCode` properties will contain the associated values.
    public var isResponseValidationError: Bool {
        if case .responseValidationFailed = self { return true }
        return false
    }

    /// Returns whether the `AFError` is a response serialization error. When `true`, the `failedStringEncoding` and
    /// `underlyingError` properties will contain the associated values.
    public var isResponseSerializationError: Bool {
        if case .responseSerializationFailed = self { return true }
        return false
    }
}

总而言之,这些都是给AFError这个枚举扩展的属性,还包含下边这些属性
urlConvertible: URLConvertible? 获取某个属性,这个属性实现了URLConvertible协议,在AFError中只有case invalidURL(url: URLConvertible)这个选项符合要求

/// The `URLConvertible` associated with the error.
      public var urlConvertible: URLConvertible? {
          switch self {
          case .invalidURL(let url):
              return url
          default:
              return nil
          }
      }

url: URL? 获取AFError中的URL,当然这个URL只跟MultipartEncodingFailureReason这个子选项有关

/// The `URL` associated with the error.
      public var url: URL? {
          switch self {
          case .multipartEncodingFailed(let reason):
              return reason.url
          default:
              return nil
          }
      }

underlyingError: Error? AFError中封装的所有的可能出现的错误中,并不是每种可能都会返回Error这个错误信息,因此这个属性是可选的

/// The `Error` returned by a system framework associated with a `.parameterEncodingFailed`,
      /// `.multipartEncodingFailed` or `.responseSerializationFailed` error.
      public var underlyingError: Error? {
          switch self {
          case .parameterEncodingFailed(let reason):
              return reason.underlyingError
          case .multipartEncodingFailed(let reason):
              return reason.underlyingError
          case .responseSerializationFailed(let reason):
              return reason.underlyingError
          default:
              return nil
          }
      }

acceptableContentTypes: [String]? 可接受的ContentType

/// The response `Content-Type` of a `.responseValidationFailed` error.
      public var responseContentType: String? {
          switch self {
          case .responseValidationFailed(let reason):
              return reason.responseContentType
          default:
              return nil
          }
      }

responseCode: Int? 响应码

/// The response code of a `.responseValidationFailed` error.
  public var responseCode: Int? {
      switch self {
      case .responseValidationFailed(let reason):
          return reason.responseCode
      default:
          return nil
      }
  }

failedStringEncoding: String.Encoding? 错误的字符串编码

/// The `String.Encoding` associated with a failed `.stringResponse()` call.
      public var failedStringEncoding: String.Encoding? {
          switch self {
          case .responseSerializationFailed(let reason):
              return reason.failedStringEncoding
          default:
              return nil
          }
      }

这里是一个小的分割线,在上边属性的获取中,也是用到了下边代码中的扩展功能:

extension AFError.ParameterEncodingFailureReason {
      var underlyingError: Error? {
          switch self {
          case .jsonEncodingFailed(let error), .propertyListEncodingFailed(let error):
              return error
          default:
              return nil
          }
      }
  }

  extension AFError.MultipartEncodingFailureReason {
      var url: URL? {
          switch self {
          case .bodyPartURLInvalid(let url), .bodyPartFilenameInvalid(let url), .bodyPartFileNotReachable(let url),
               .bodyPartFileIsDirectory(let url), .bodyPartFileSizeNotAvailable(let url),
               .bodyPartInputStreamCreationFailed(let url), .outputStreamCreationFailed(let url),
               .outputStreamFileAlreadyExists(let url), .outputStreamURLInvalid(let url),
               .bodyPartFileNotReachableWithError(let url, _), .bodyPartFileSizeQueryFailedWithError(let url, _):
              return url
          default:
              return nil
          }
      }

      var underlyingError: Error? {
          switch self {
          case .bodyPartFileNotReachableWithError(_, let error), .bodyPartFileSizeQueryFailedWithError(_, let error),
               .outputStreamWriteFailed(let error), .inputStreamReadFailed(let error):
              return error
          default:
              return nil
          }
      }
  }

  extension AFError.ResponseValidationFailureReason {
      var acceptableContentTypes: [String]? {
          switch self {
          case .missingContentType(let types), .unacceptableContentType(let types, _):
              return types
          default:
              return nil
          }
      }

      var responseContentType: String? {
          switch self {
          case .unacceptableContentType(_, let responseType):
              return responseType
          default:
              return nil
          }
      }

      var responseCode: Int? {
          switch self {
          case .unacceptableStatusCode(let code):
              return code
          default:
              return nil
          }
      }
  }

  extension AFError.ResponseSerializationFailureReason {
      var failedStringEncoding: String.Encoding? {
          switch self {
          case .stringSerializationFailed(let encoding):
              return encoding
          default:
              return nil
          }
      }

      var underlyingError: Error? {
          switch self {
          case .jsonSerializationFailed(let error), .propertyListSerializationFailed(let error):
              return error
          default:
              return nil
          }
      }
  }

错误描述

在开发中,如果程序遇到错误,我们往往会给用户展示更加直观的信息,这就要求我们把错误信息转换成易于理解的内容。因此我们只要实现LocalizedError协议就好了。这里边的内容很简单,在这里就直接把代码写上了,不做分析

extension AFError: LocalizedError {
    public var errorDescription: String? {
        switch self {
        case .invalidURL(let url):
            return "URL is not valid: \(url)"
        case .parameterEncodingFailed(let reason):
            return reason.localizedDescription
        case .multipartEncodingFailed(let reason):
            return reason.localizedDescription
        case .responseValidationFailed(let reason):
            return reason.localizedDescription
        case .responseSerializationFailed(let reason):
            return reason.localizedDescription
        }
    }
}

extension AFError.ParameterEncodingFailureReason {
    var localizedDescription: String {
        switch self {
        case .missingURL:
            return "URL request to encode was missing a URL"
        case .jsonEncodingFailed(let error):
            return "JSON could not be encoded because of error:\n\(error.localizedDescription)"
        case .propertyListEncodingFailed(let error):
            return "PropertyList could not be encoded because of error:\n\(error.localizedDescription)"
        }
    }
}

extension AFError.MultipartEncodingFailureReason {
    var localizedDescription: String {
        switch self {
        case .bodyPartURLInvalid(let url):
            return "The URL provided is not a file URL: \(url)"
        case .bodyPartFilenameInvalid(let url):
            return "The URL provided does not have a valid filename: \(url)"
        case .bodyPartFileNotReachable(let url):
            return "The URL provided is not reachable: \(url)"
        case .bodyPartFileNotReachableWithError(let url, let error):
            return (
                "The system returned an error while checking the provided URL for " +
                "reachability.\nURL: \(url)\nError: \(error)"
            )
        case .bodyPartFileIsDirectory(let url):
            return "The URL provided is a directory: \(url)"
        case .bodyPartFileSizeNotAvailable(let url):
            return "Could not fetch the file size from the provided URL: \(url)"
        case .bodyPartFileSizeQueryFailedWithError(let url, let error):
            return (
                "The system returned an error while attempting to fetch the file size from the " +
                "provided URL.\nURL: \(url)\nError: \(error)"
            )
        case .bodyPartInputStreamCreationFailed(let url):
            return "Failed to create an InputStream for the provided URL: \(url)"
        case .outputStreamCreationFailed(let url):
            return "Failed to create an OutputStream for URL: \(url)"
        case .outputStreamFileAlreadyExists(let url):
            return "A file already exists at the provided URL: \(url)"
        case .outputStreamURLInvalid(let url):
            return "The provided OutputStream URL is invalid: \(url)"
        case .outputStreamWriteFailed(let error):
            return "OutputStream write failed with error: \(error)"
        case .inputStreamReadFailed(let error):
            return "InputStream read failed with error: \(error)"
        }
    }
}

extension AFError.ResponseSerializationFailureReason {
    var localizedDescription: String {
        switch self {
        case .inputDataNil:
            return "Response could not be serialized, input data was nil."
        case .inputDataNilOrZeroLength:
            return "Response could not be serialized, input data was nil or zero length."
        case .inputFileNil:
            return "Response could not be serialized, input file was nil."
        case .inputFileReadFailed(let url):
            return "Response could not be serialized, input file could not be read: \(url)."
        case .stringSerializationFailed(let encoding):
            return "String could not be serialized with encoding: \(encoding)."
        case .jsonSerializationFailed(let error):
            return "JSON could not be serialized because of error:\n\(error.localizedDescription)"
        case .propertyListSerializationFailed(let error):
            return "PropertyList could not be serialized because of error:\n\(error.localizedDescription)"
        }
    }
}

extension AFError.ResponseValidationFailureReason {
    var localizedDescription: String {
        switch self {
        case .dataFileNil:
            return "Response could not be validated, data file was nil."
        case .dataFileReadFailed(let url):
            return "Response could not be validated, data file could not be read: \(url)."
        case .missingContentType(let types):
            return (
                "Response Content-Type was missing and acceptable content types " +
                "(\(types.joined(separator: ","))) do not match \"*/*\"."
            )
        case .unacceptableContentType(let acceptableTypes, let responseType):
            return (
                "Response Content-Type \"\(responseType)\" does not match any acceptable types: " +
                "\(acceptableTypes.joined(separator: ","))."
            )
        case .unacceptableStatusCode(let code):
            return "Response status code was unacceptable: \(code)."
        }
    }
}

总结

通过阅读AFError这篇代码,给了我很大的震撼,在代码的设计上,可以参考这种设计方式。
由于知识水平有限,如有错误,还望指出

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 213,616评论 6 492
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 91,020评论 3 387
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 159,078评论 0 349
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 57,040评论 1 285
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 66,154评论 6 385
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,265评论 1 292
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,298评论 3 412
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,072评论 0 268
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,491评论 1 306
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,795评论 2 328
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,970评论 1 341
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,654评论 4 337
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,272评论 3 318
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,985评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,223评论 1 267
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,815评论 2 365
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,852评论 2 351

推荐阅读更多精彩内容