CopyRates/Copybuffer error checks

 
void OnStart()
  {
//---
   MqlRates rates[];
   ArraySetAsSeries(rates,true);
   int copied=CopyRates(Symbol(),0,0,100,rates);
   if(copied>0)
     {
      Print("Bars copied: "+copied);
      string format="open = %G, high = %G, low = %G, close = %G, volume = %d";
      string out;
      int size=fmin(copied,10);
      for(int i=0;i<size;i++)
        {
         out=i+":"+TimeToString(rates[i].time);
         out=out+" "+StringFormat(format,
                                  rates[i].open,
                                  rates[i].high,
                                  rates[i].low,
                                  rates[i].close,
                                  rates[i].tick_volume);
         Print(out);
        }
     }
   else Print("Failed to get history data for the symbol ",Symbol());
  }


I'm trying to understand how to code some error checks for Copyrates and copybuffer. I'm struggling to understand the logic in the example. I don't understand the if copied is greater than 0 line. Is this checking elements of the array or something else? Is there a good article on how to go about this? I know I can just copy this code and it will work but would like to understand it. Thanks in advance for any help offered 

 
I've managed to figure this out but thought I'd leave this here for anyone else that comes across this. 

CopyRates has a return value which is described below 

Returns the number of copied elements or -1 in case of an error.