Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions Sources/YData/Core/Error/GenericFabricError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,22 @@ public struct GenericFabricError: FabricError {
public var context: [String: String]?
public var description: String
public var httpCode: Int = 500
internal var _name: String? // swiftlint:disable:this identifier_name
public var name: String
public var returnValue: Int

public var name: String {
get {
_name ?? "\(Self.self)"
}

set {
_name = newValue
}
}

public init(
context: [String: String]? = nil,
description: String,
httpCode: Int? = 500,
name: String? = nil,
name: String = "\(Self.self)",
returnValue: Int
) {
self.context = context
self.description = description
if let httpCode {
self.httpCode = httpCode
}
self._name = name
self.name = name
self.returnValue = returnValue
}
}
2 changes: 1 addition & 1 deletion Sources/YData/Database/DatabaseClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import Foundation

public protocol DatabaseClient {
associatedtype Context: DatabaseClientContext

var context: Context { get }
}
6 changes: 3 additions & 3 deletions Sources/YData/Extensions/String+random.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import Foundation
public extension String {
static func random(length: Int) -> String {
let letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!?+-*/=_#$%&"
var s = ""
var result = ""
for _ in 0 ..< length {
s.append(letters.randomElement()!)
result.append(letters.randomElement()!) // swiftlint:disable:this force_unwrap
}
return s
return result
}
}