buildasaurs / XcodeServerSDK

Access Xcode Server API with native Swift objects.
MIT License
399 stars 30 forks source link

Crash - no available platforms on Xcode Server #114

Closed czechboy0 closed 8 years ago

czechboy0 commented 8 years ago

Happens on certain instances of Xcode Server

Application Specific Information:
fatal error: Couldn't find intended platform in list of platforms: []!: file /Users/honzadvorsky/Documents/Buildasaur/Pods/XcodeServerSDK/XcodeServerSDK/API Routes/XcodeServer+Bot.swift, line 172

Originally reported by @valeriomazzeo in https://github.com/czechboy0/Buildasaur/issues/143.


Solution:

cojoj commented 8 years ago

You rather want it to return some kind of completion or simply throw?

cojoj commented 8 years ago

I think if we want to fail bot creation process we should stick with throw 😉 I'll try to do something with this issue today...

czechboy0 commented 8 years ago

It's an asynchronous process so I don't think throw will work. Just creating an error and completing should be enough. On Thu, Oct 1, 2015 at 9:53 AM Mateusz ZajÄ…c notifications@github.com wrote:

I think if we want to fail bot creation process we should stick with throw 😉 I'll try to do something with this issue today...

— Reply to this email directly or view it on GitHub https://github.com/czechboy0/XcodeServerSDK/issues/114#issuecomment-144659844 .

cojoj commented 8 years ago

private func replacePlaceholderPlatformInBot(bot: Bot, platforms: [DevicePlatform]) is the method in which the fatalErrors are called... Looks to me like it's totally synchronous. The bot creation isn't synchronous... Anyway, you suggest returning of the optional ErrorType from this method? Seems legit 😉

czechboy0 commented 8 years ago

Oh right, I was talking about the big picture of the whole process. Makes perfect sense here to throw, sorry. What I meant is that that error should then be fed into the failing completion block. On Thu, Oct 1, 2015 at 10:02 AM Mateusz ZajÄ…c notifications@github.com wrote:

private func replacePlaceholderPlatformInBot(bot: Bot, platforms: [DevicePlatform]) is the method in which the fatalErrors are called... Looks to me like it's totally synchronous. The bot creation isn't synchronous... Anyway, you suggest returning of the optional ErrorType from this method? Seems legit 😉

— Reply to this email directly or view it on GitHub https://github.com/czechboy0/XcodeServerSDK/issues/114#issuecomment-144662510 .

cojoj commented 8 years ago

Communication is always an issue in my case 😜 Great that we're now on the same tracks!